jfxtras-labs icon indicating copy to clipboard operation
jfxtras-labs copied to clipboard

Rectangle Position in MouseControlUtil.addSelectionRectangleGesture incorrect

Open IARI opened this issue 5 years ago • 2 comments

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.

IARI avatar Mar 21 '19 23:03 IARI

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.

tbee avatar Mar 22 '19 06:03 tbee

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.

miho avatar Mar 22 '19 09:03 miho