JFXtras/jfxtras-labs

Rectangle Position in MouseControlUtil.addSelectionRectangleGesture incorrect

Opened this issue · 2 comments

IARI commented

The Bug described here was first also described in this comment on a stackoverflow answer which suggests the use of MouseControlUtil.addSelectionRectangleGesture:

Whenever I call the function with the final Parent root argument being some Pane within a Scene, the rectangle position is incorrect:

2019-03-22-00-33-08

The reason to me seems to be in the performDragBegin method, MouseControlUtil.java L385-L386
The initial position is obtained from the scene-absolute coordinates, but the rectangle is attached to an element down in the hierarchy of the scene tree - that does not seem correct and i suspect it is the cause of this problem.

Sidenote:
from the design of this peace of te code, it seems to be intended in a way, that the final Parent root argument is in fact - as in this example - down in the hierarchy of the scene tree.

I am aware that this is experimental code, so I am submitting this issue, so this can be fixed.

tbee commented

As you mention yourself, labs is our sandbox and any code in there may be abandoned. I'll see if the owner still is supporting it.

miho commented

The MouseControlUtil does only compute the scaling (LocalToSceneTransform) but it ignores the necessary translation. In VWorkflows we do the necessary translation: See lines 408 - 445.