diff options
author | Sven Gothel <[email protected]> | 2011-05-06 14:39:17 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2011-05-06 14:39:17 +0200 |
commit | d75835796900cac602f7e5789601ffba0a27efe2 (patch) | |
tree | 4331f4fa053f2f2ea02eee4c1974d7ea71689be0 /src/jogl/classes/jogamp/graph/curve | |
parent | 59aa8737528743b83cf56b804c9d713bc325c97c (diff) |
Graph: More std. functionality (equals, clone) / Better in-place transformation (cubic -> quadratic)
Impl. more of John Pritchard <[email protected]> proposal
https://github.com/syntelos/jogl/commit/05a7ec92d30e1e688b1eb7cc317cad83a0e8fd60
+++
More std. functionality (equals, deep clone) of AABBox, Vertex, Outline and OutlineShape.
Simplify Vertex:
- Remove 2 component constructor
- Add on-curve in Vertex.Factory / Constructor
- Adding equals(Object)
- Remove Comparable/compareTo, since we only can make an equals statement
Outline/OutlineShape: Handle dirty flag for boundary (new set/remove operation)
OutlineShape: Better in-place transformation (cubic -> quadratic)
Diffstat (limited to 'src/jogl/classes/jogamp/graph/curve')
-rw-r--r-- | src/jogl/classes/jogamp/graph/curve/text/GlyphShape.java | 35 |
1 files changed, 7 insertions, 28 deletions
diff --git a/src/jogl/classes/jogamp/graph/curve/text/GlyphShape.java b/src/jogl/classes/jogamp/graph/curve/text/GlyphShape.java index 433019361..46d7fa947 100644 --- a/src/jogl/classes/jogamp/graph/curve/text/GlyphShape.java +++ b/src/jogl/classes/jogamp/graph/curve/text/GlyphShape.java @@ -81,43 +81,22 @@ public class GlyphShape { if(!shape.getLastOutline().isEmpty()){ shape.addEmptyOutline(); } - Vertex vert = vertexFactory().create(coords[0],coords[1]); - vert.setOnCurve(true); - addVertexToLastOutline(vert); - + addVertexToLastOutline(vertexFactory().create(coords, 0, 2, true)); numVertices++; } else if(segmentType == PathIterator.SEG_LINETO){ - Vertex vert1 = vertexFactory().create(coords[0],coords[1]); - vert1.setOnCurve(true); - addVertexToLastOutline(vert1); - + addVertexToLastOutline(vertexFactory().create(coords, 0, 2, true)); numVertices++; } else if(segmentType == PathIterator.SEG_QUADTO){ - Vertex vert1 = vertexFactory().create(coords[0],coords[1]); - vert1.setOnCurve(false); - addVertexToLastOutline(vert1); - - Vertex vert2 = vertexFactory().create(coords[2],coords[3]); - vert2.setOnCurve(true); - addVertexToLastOutline(vert2); - + addVertexToLastOutline(vertexFactory().create(coords, 0, 2, false)); + addVertexToLastOutline(vertexFactory().create(coords, 2, 2, true)); numVertices+=2; } else if(segmentType == PathIterator.SEG_CUBICTO){ - Vertex vert1 = vertexFactory().create(coords[0],coords[1]); - vert1.setOnCurve(false); - addVertexToLastOutline(vert1); - - Vertex vert2 = vertexFactory().create(coords[2],coords[3]); - vert2.setOnCurve(false); - addVertexToLastOutline(vert2); - - Vertex vert3 = vertexFactory().create(coords[4],coords[5]); - vert3.setOnCurve(true); - addVertexToLastOutline(vert3); - + addVertexToLastOutline(vertexFactory().create(coords, 0, 2, false)); + addVertexToLastOutline(vertexFactory().create(coords, 2, 2, false)); + addVertexToLastOutline(vertexFactory().create(coords, 4, 2, true)); numVertices+=3; } else if(segmentType == PathIterator.SEG_CLOSE){ |