diff options
author | Sven Gothel <[email protected]> | 2023-03-27 15:51:59 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2023-03-28 02:43:11 +0200 |
commit | a88a261a6cc78977224c9311d8383ead881d98bc (patch) | |
tree | 1ab3836bc13fe5b750090771a51194a63e59cc25 /src/graphui/classes/com/jogamp/graph | |
parent | 9bb1c269bc64d385e2b584c34f842990f72ad31d (diff) |
GraphUI: Shape.dispatchMouseEvent(): Rename dsx/dsxy -> sx/sy as they denominate whole scale-factor, not their delta
Diffstat (limited to 'src/graphui/classes/com/jogamp/graph')
-rw-r--r-- | src/graphui/classes/com/jogamp/graph/ui/gl/Shape.java | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/graphui/classes/com/jogamp/graph/ui/gl/Shape.java b/src/graphui/classes/com/jogamp/graph/ui/gl/Shape.java index 90a247379..920602adb 100644 --- a/src/graphui/classes/com/jogamp/graph/ui/gl/Shape.java +++ b/src/graphui/classes/com/jogamp/graph/ui/gl/Shape.java @@ -1054,26 +1054,26 @@ public abstract class Shape { if( 0 != inResize && resizable ) { final float bw = box.getWidth(); final float bh = box.getHeight(); - final float dsx; + final float sx; if( 1 == inResize ) { - dsx = scale[0] + sdx/bw; // bottom-right + sx = scale[0] + sdx/bw; // bottom-right } else { - dsx = scale[0] - sdx/bw; // bottom-left + sx = scale[0] - sdx/bw; // bottom-left } - final float dsy = scale[1] - sdy/bh; - if( resize_sxy_min <= dsx && resize_sxy_min <= dsy ) { // avoid scale flip + final float sy = scale[1] - sdy/bh; + if( resize_sxy_min <= sx && resize_sxy_min <= sy ) { // avoid scale flip if( DEBUG ) { System.err.printf("DragZoom: resize %d, win[%4d, %4d], obj[%.4f, %.4f, %.4f], dxy +[%.4f, %.4f], sdxy +[%.4f, %.4f], scale [%.4f, %.4f] -> [%.4f, %.4f]%n", inResize, glWinX, glWinY, objPos[0], objPos[1], objPos[2], shapeEvent.objDrag[0], shapeEvent.objDrag[1], sdx, sdy, - scale[0], scale[1], dsx, dsy); + scale[0], scale[1], sx, sy); } if( 1 == inResize ) { move( 0, sdy, 0f); // bottom-right, sticky left- and top-edge } else { move( sdx, sdy, 0f); // bottom-left, sticky right- and top-edge } - setScale(dsx, dsy, scale[2]); + setScale(sx, sy, scale[2]); } return; // FIXME: pass through event? Issue zoom event? } else if( inDrag && draggable ) { |