]> Shamusworld >> Repos - ttedit/blobdiff - src/glyphpoints.cpp
Added some functions to GlyphPoints to reduce redundancy in glyph
[ttedit] / src / glyphpoints.cpp
index d7ce0d5b19d082d629c28aa9f8458142830402e2..0fc62f3cd40af42b8bf2603bc8d5aad7330e2bb2 100755 (executable)
@@ -368,6 +368,11 @@ WriteLogMsg("Exception: GetX(uint16, uint16). poly= %u, pt=%u, numPoints=%u\xD\x
        return x[pt + (poly == 0 ? 0 : polyEnd[poly - 1] + 1)];
 }
 
+int GlyphPoints::GetNextX(uint16 poly, uint16 pt)
+{
+       return GetX(poly, GetNext(poly, pt));
+}
+
 int GlyphPoints::GetY(uint16 poly, uint16 pt)
 {
        if (pt >= GetNumPoints(poly))
@@ -383,6 +388,16 @@ WriteLogMsg("Exception: GetY(uint16, uint16). poly= %u, pt=%u, numPoints=%u\xD\x
        return y[pt + (poly == 0 ? 0 : polyEnd[poly - 1] + 1)];
 }
 
+int GlyphPoints::GetNextY(uint16 poly, uint16 pt)
+{
+       return GetY(poly, GetNext(poly, pt));
+}
+
+IPoint GlyphPoints::GetPoint(uint16 poly, uint16 pt)
+{
+       return IPoint(GetX(poly, pt), GetY(poly, pt));
+}
+
 bool GlyphPoints::GetOnCurve(uint16 poly, uint16 pt)
 {
        if (pt >= GetNumPoints(poly))
@@ -398,6 +413,16 @@ WriteLogMsg("Exception: GetOnCurve(uint16, uint16). poly= %u, pt=%u, numPoints=%
        return onCurve[pt + (poly == 0 ? 0 : polyEnd[poly - 1] + 1)];
 }
 
+bool GlyphPoints::GetPrevOnCurve(uint16 poly, uint16 pt)
+{
+       return GetOnCurve(poly, GetPrev(poly, pt));
+}
+
+bool GlyphPoints::GetNextOnCurve(uint16 poly, uint16 pt)
+{
+       return GetOnCurve(poly, GetNext(poly, pt));
+}
+
 uint16 GlyphPoints::GetPolyEnd(uint16 poly)
 {
        if (poly >= numPolys)