aboutsummaryrefslogtreecommitdiffstats
path: root/src/graphui/classes/com/jogamp/graph/ui/shapes/GlyphShape.java
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2023-09-16 15:43:48 +0200
committerSven Gothel <[email protected]>2023-09-16 15:43:48 +0200
commit6f6841941abf326ebdc09173fe4e7c678d2c5569 (patch)
tree9051f25212bf82bec9b65a0446b7d945bdb3d8cf /src/graphui/classes/com/jogamp/graph/ui/shapes/GlyphShape.java
parentaac1265340ae2ee1cad6bbf89369ba0288a6a290 (diff)
GraphUI GlyphShape: Add copy-ctor variant
Diffstat (limited to 'src/graphui/classes/com/jogamp/graph/ui/shapes/GlyphShape.java')
-rw-r--r--src/graphui/classes/com/jogamp/graph/ui/shapes/GlyphShape.java17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/graphui/classes/com/jogamp/graph/ui/shapes/GlyphShape.java b/src/graphui/classes/com/jogamp/graph/ui/shapes/GlyphShape.java
index 76e454c12..ade147e50 100644
--- a/src/graphui/classes/com/jogamp/graph/ui/shapes/GlyphShape.java
+++ b/src/graphui/classes/com/jogamp/graph/ui/shapes/GlyphShape.java
@@ -82,6 +82,18 @@ public class GlyphShape extends GraphShape {
/**
* Creates a new GlyphShape
* @param renderModes Graph's {@link Region} render modes, see {@link GLRegion#create(GLProfile, int, TextureSequence) create(..)}.
+ * @param symbol the represented character
+ * @param glyph the {@link Font.Glyph}
+ * @param pos the intended unscaled Vec3f position of this Glyph, e.g. if part of a string - otherwise use zero.
+ * @see #processString(List, int, Font, String)
+ */
+ public GlyphShape(final int renderModes, final char symbol, final Glyph glyph, final Vec3f pos) {
+ this(renderModes, symbol, glyph, pos.x(), pos.y());
+ }
+
+ /**
+ * Creates a new GlyphShape
+ * @param renderModes Graph's {@link Region} render modes, see {@link GLRegion#create(GLProfile, int, TextureSequence) create(..)}.
* @param font the {@link Font} to lookup the symbol's {@link Font.Glyph}
* @param symbol the represented character
* @param x the intended unscaled X position of this Glyph, e.g. if part of a string - otherwise use zero.
@@ -91,6 +103,11 @@ public class GlyphShape extends GraphShape {
this(renderModes, symbol, font.getGlyph( font.getGlyphID(symbol) ), x, y);
}
+ /** GlyphShape copy-ctor */
+ public GlyphShape(final GlyphShape orig) {
+ this(orig.renderModes, orig.symbol, orig.glyph, orig.origPos);
+ }
+
/** Returns the char symbol to be rendered. */
public char getSymbol() {
return symbol;