summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/graphui/classes/com/jogamp/graph/ui/gl/shapes/Label.java7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/graphui/classes/com/jogamp/graph/ui/gl/shapes/Label.java b/src/graphui/classes/com/jogamp/graph/ui/gl/shapes/Label.java
index 5d45ffb9c..90094c361 100644
--- a/src/graphui/classes/com/jogamp/graph/ui/gl/shapes/Label.java
+++ b/src/graphui/classes/com/jogamp/graph/ui/gl/shapes/Label.java
@@ -182,10 +182,11 @@ public class Label extends Shape {
@Override
protected void addShapeToRegion() {
+ AABBox fbox = font.getGlyphBounds(text, tempT2, tempT3);
tempT1.setToScale(fontScale, fontScale);
- final AABBox fbox = font.processString(glyphVisitor, tempT1, text, tempT2, tempT3);
- final float[] ctr = fbox.getCenter();
- setRotationOrigin( ctr[0], ctr[1], ctr[2]);
+ tempT1.translate(-fbox.getMinX(), -fbox.getMinY(), tempT2); // enforce bottom-left origin @ 0/0 for good drag-zoom experience
+ fbox = font.processString(glyphVisitor, tempT1, text, tempT2, tempT3);
+ setRotationPivot( fbox.getCenter() );
box.copy(fbox);
}