diff options
author | Sven Gothel <[email protected]> | 2023-03-14 15:13:34 +0100 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2023-03-14 15:13:34 +0100 |
commit | 40286313e716c476308b7621b6031c485aaff7be (patch) | |
tree | ee2a701e5aa7f6f92375eb1e4609f8bd40ac8dfc /src/graphui/classes/com/jogamp/graph/ui | |
parent | e219ce85b450f760671f07fde72c8d119616bb8f (diff) |
GraphUI: Label: Rename pixelSize -> pixelScale, since we are view-based or in model-space.
Diffstat (limited to 'src/graphui/classes/com/jogamp/graph/ui')
-rw-r--r-- | src/graphui/classes/com/jogamp/graph/ui/gl/shapes/Label.java | 19 |
1 files changed, 10 insertions, 9 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 ab1d08872..ce6cf9163 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 @@ -47,13 +47,13 @@ import com.jogamp.graph.ui.gl.Shape; */ public class Label extends Shape { protected Font font; - protected float pixelSize; + protected float pixelScale; protected String text; - public Label(final Factory<? extends Vertex> factory, final int renderModes, final Font font, final float pixelSize, final String text) { + public Label(final Factory<? extends Vertex> factory, final int renderModes, final Font font, final float pixelScale, final String text) { super(factory, renderModes); this.font = font; - this.pixelSize = pixelSize; + this.pixelScale = pixelScale; this.text = text; } @@ -93,16 +93,17 @@ public class Label extends Shape { } } - public float getPixelSize() { - return pixelSize; + public float getPixelScale() { + return pixelScale; } + /** Returns {@link Font#getLineHeight()} * {@link #getPixelScale()}. */ public float getLineHeight() { - return pixelSize * font.getLineHeight(); + return pixelScale * font.getLineHeight(); } public void setPixelSize(final float pixelSize) { - this.pixelSize = pixelSize; + this.pixelScale = pixelSize; markShapeDirty(); } @@ -129,7 +130,7 @@ public class Label extends Shape { @Override protected void addShapeToRegion(final GL2ES2 gl, final RegionRenderer renderer) { - tempT1.setToScale(pixelSize, pixelSize); + tempT1.setToScale(pixelScale, pixelScale); final AABBox fbox = font.processString(shapeVisitor, tempT1, text, tempT2, tempT3); final float[] ctr = box.getCenter(); setRotationOrigin( ctr[0], ctr[1], ctr[2]); @@ -139,6 +140,6 @@ public class Label extends Shape { @Override public String getSubString() { final int m = Math.min(text.length(), 8); - return super.getSubString()+", psize " + pixelSize + ", '" + text.substring(0, m)+"'"; + return super.getSubString()+", pscale " + pixelScale + ", '" + text.substring(0, m)+"'"; } } |