From 6f6841941abf326ebdc09173fe4e7c678d2c5569 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Sat, 16 Sep 2023 15:43:48 +0200 Subject: GraphUI GlyphShape: Add copy-ctor variant --- .../classes/com/jogamp/graph/ui/shapes/GlyphShape.java | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'src/graphui/classes/com/jogamp/graph') 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 @@ -79,6 +79,18 @@ public class GlyphShape extends GraphShape { regionIdxCount = vertIndexCount[1]; } + /** + * 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(..)}. @@ -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; -- cgit v1.2.3