question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

no event (mousedown, mouseup, mousemove) will fire on lines (unless their path is opened)

See original GitHub issue

Here’s the thing:

I create a line:

new Graphics()
interactive = true
buttonMode = true
beginFill()
lineStyle()
moveTo(50, 50)
lineTo(150, 150)
endFill()
stage.addChild( line )

at this point: I can drag the line, but something’s not right, cause I can drag the line even If I click not on the line itself, but to the left of it, or to the right. (it’s like its path is open or something)

Okey that’s not useful, So I try to close the line:

moveTo(50, 50)
lineTo(150, 150)
lineTo(50, 50)

But now, Its interactive ness and buttonMode ness is gone.

What’s happening here?

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:19 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
staff0rdcommented, Dec 1, 2016

The line is centered on the shape’s bounds - so half of the line is inside the bounds, half of the line is outside the bounds. Only the part of the line that is inside the bounds is clickable.

0reactions
lock[bot]commented, Feb 24, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Read more comments on GitHub >

github_iconTop Results From Across the Web

no event (mousedown, mouseup, mousemove) will fire on ...
Here's the thing: I create a line: new Graphics() interactive = true buttonMode = true beginFill() lineStyle() moveTo(50, 50) lineTo(150, ...
Read more >
Element: mousemove event - Web APIs | MDN
The mousemove event is fired at an element when a pointing device (usually a mouse) is moved while the cursor's hotspot is inside...
Read more >
Events-- 'mouseup' not firing after mousemove - Stack Overflow
The event which you want to fire in mouseup , You can fire in mousedown and inside the function write event.stopPropagation() .
Read more >
161464 - Click event also triggers mousemove (even if mouse ...
But NOT receiving mouseup/mousedown when you should, or ANY state that survives closing/opening the tab is something much more serious. I guess there's...
Read more >
Mouse events - The Modern JavaScript Tutorial
Every mouse move over an element triggers that event. click: Triggers after mousedown and then mouseup over the same element if the left...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found