File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed
app/display/editor/src/main/java/org/csstudio/display/builder/editor/util Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -83,9 +83,22 @@ private void handleDrag(final MouseEvent event)
8383 {
8484 if (! active )
8585 return ;
86+
87+ // Get the current coords of the pointer, relative to the parent
8688 final Point2D in_parent = parent .sceneToLocal (event .getSceneX (), event .getSceneY ());
8789 x1 = in_parent .getX ();
8890 y1 = in_parent .getY ();
91+
92+ // If outside the parent window,
93+ // then set the coords to the parent window border (zero)
94+ if (x1 <-1 ) {
95+ x1 = 0 ;
96+ }
97+ if (y1 <-1 ) {
98+ y1 = 0 ;
99+ }
100+
101+ // Update the rectangle coords and dimensions
89102 rect .setX (Math .min (x0 , x1 ));
90103 rect .setY (Math .min (y0 , y1 ));
91104 rect .setWidth (Math .abs (x1 - x0 ));
You can’t perform that action at this time.
0 commit comments