diff options
author | Sven Gothel <[email protected]> | 2023-03-21 14:24:50 +0100 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2023-03-21 14:24:50 +0100 |
commit | d025006b8d24382bad810070f4fa5368f66ff223 (patch) | |
tree | 6afbd8a2d980615e8837af89ca95ec36c4252619 /src/graphui | |
parent | 74e11bd9a49f61e49d3c73c4f9b87b4fb7fbaaf3 (diff) |
GraphUI Shape.setTransform(): Remove 'wiggling' w/ origin, text issue came from Scene.PMVMatrixSetup bug, all shapes resize fine now.
Scene.PMVMatrixSetup bug missed modelview initialition before gluUnProject(), fixed in commit 74e11bd9a49f61e49d3c73c4f9b87b4fb7fbaaf3.
Diffstat (limited to 'src/graphui')
-rw-r--r-- | src/graphui/classes/com/jogamp/graph/ui/gl/Shape.java | 16 |
1 files changed, 4 insertions, 12 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 52a17f49a..996182708 100644 --- a/src/graphui/classes/com/jogamp/graph/ui/gl/Shape.java +++ b/src/graphui/classes/com/jogamp/graph/ui/gl/Shape.java @@ -455,14 +455,8 @@ public abstract class Shape { final float hh = ctr[1] - low[1]; final float hd = ctr[2] - low[2]; - // 1) text top moving; Button Good - // pmv.glTranslatef(uiTranslate[0]-hw, uiTranslate[1]-hh, uiTranslate[2]-hd); // translate less unscaled-center - // 2) text sticky moving ; Button sticky moving - // pmv.glTranslatef(uiTranslate[0]+low[0], uiTranslate[1]+low[1], uiTranslate[2]+low[2]); // translate from origin - // 3) text OK'sh, but sticky moving ; Button Good - pmv.glTranslatef(uiTranslate[0]+low[0]-hw, uiTranslate[1]+low[1]-hh, uiTranslate[2]+low[2]-hd); // translate from origin less unscaled-center - - // pmv.glTranslatef(uiTranslate[0], uiTranslate[1], uiTranslate[2]); + pmv.glTranslatef(uiTranslate[0]-hw, uiTranslate[1]-hh, uiTranslate[2]-hd); // translate less unscaled-center + final Quaternion quat = getRotation(); final boolean rotate = !quat.isIdentity(); final float[] uiScale = getScale(); @@ -483,10 +477,8 @@ public abstract class Shape { pmv.glTranslatef(-rotOrigin[0], -rotOrigin[1], -rotOrigin[2]); } } - // TODO: Add alignment features. This also shall resolve scaling of multi-line text, i.e. sticky-edges to stay sticky! - // pmv.glTranslatef(hw, hh, hd); // add-back center, scaled - // pmv.glTranslatef(-low[0], -low[1], -low[2]); // add-back origin-distance, scaled - pmv.glTranslatef(hw-low[0], hh-low[1], hd-low[2]); // add back origin-distance and center, scaled + // TODO: Add alignment features. + pmv.glTranslatef(hw, hh, hd); // add-back center, scaled } /** |