Lasso component bug

You’re supposed to end the lasso tracking in a mouseUp. So how can you allow that to happen if the user has dragged the lasso off the edge of the main window? The mouse is no longer over any components, so i can’t use a globalMouseListener, and it’s not something you can prevent the user from doing.

This is a very serious issue, and i have no idea how to fix it!

I wouldn’t use a global mouse listener for that kind of thing - just attach a normal mouse listener to the parent component and it’ll correctly get mouseDrag and mouseUps wherever the mouse gets dragged to.

i’m talking about the mouse being dragged off the edge of the window. the border around the component that hosts the lasso is fairly small, and it’s easy to drag a lasso off the program window by mistake. If the mouse up occurs there, then the lasso gets left there, which is a problem.

I don’t know how to solve it (i know the global listener thing isn’t the way, but it’s the only thing i could think of to come close to recieving a mouse up that isn’t over the window)

Normal mouse listeners and components always continue to get drag messages until the button is released, even when the mouse goes off the window - it’s only the global mouse thing that doesn’t do that (although it probably should do).

I’ve found what the problem was! it’s not that the mouseUp wasn’t getting called - it was. My breakpoint was in the wrong place - the problem is that “e.mods.isRightButtonDown()” always returns false if the mouseup came from outside the window. My lasso is controlled with the right mouse button, y’see.

Thanks for the help!