Closed lifesbest23 closed 2 years ago
I see you just fixed the second part with b3b0021c5aeba2a77ea46e0ad1cb83ddf0571ba4 in #183
Thank you for testing!
I haven't noticed the exception but it seems to be fixed in the latest commit.
The error still occurs with the latest commit, even though less often. The corner selection works better but if you drag somewhere inside the rectangle or outside of it, too far away from any of the four corners, it still throws a NullPointerException
.
Another case for the error is when any other mouse button is pressed and released while dragging/scaling.
Since EnlargeLineAction:onDrag
uses the mouseStartPoint
, there should be a check before it is used.
I will add a comment in your PR with the change.
Your comment helps me a lot to realize the cause of error.
Another case for the error is when any other mouse button is pressed and released while dragging/scaling.
I can't reproduce this error because the touch pad of my Surface doesn't allow me to press 2 mouse buttons at the same time and I don't have a mouse. I added button type check on press/release/drag. I hope it will work.
With the newest changes I am no longer able to produce the error in any way. Great Fixes you applied there.
Fixed in 70cdcf5e263784d4617e80961c9ad50377cbf57e
While testing the new selection enlarger action I got the following NullPointerException, when I tried to drag/enlarge any set of selected lines while the mouse hovered over any of the selectable lines. To reproduce you just have to drag at any time when there is no pink
mouseStartPoint
visible.The exception also appears when using centered scaling.
It can be fixed by checking if
EnlargeLineAction.mouseStartPoint
is defined before executingEnlargeLineAction:onDrag
.In addition to that I found the starting point selection should be possible even if
paintContext.getCandidateLineToPick()
is not null. The current implementation prevents certain corners from being the start point, if there are selectable lines around it at least 45° apart from each other, like here: