+/*
+So, to make it draw the point the pointer is pointing at, we need to do something. Either patch the GlyphPoints to handle it, or insert the point into the GlyphPoints and delete it if the user changes tools. Either way, need
+to change the color of the line(s) drawn to the point to signal to the user
+that it isn't finalized until they click the button.
+*/
+void EditWindow::DrawGlyphPoly(Painter & p, GlyphPoints & glyph, uint16_t poly)
+{
+ // Sanity check
+ if (glyph.GetNumPoints(poly) < 3)
+ return;
+
+ IPoint p1 = glyph.GetPrevPoint(poly, 0);
+ IPoint p2 = glyph.GetPoint(poly, 0);
+
+ // Inject the new poly point into the current polygon
+ if ((tool == TOOLAddPoly) && (poly == (glyph.GetNumPolys() - 1)))
+ {
+ p1 = IPoint(addPoint.x, addPoint.y, addPointOnCurve);
+ }
+
+ for(int i=0; i<glyph.GetNumPoints(poly); i++)
+ {
+ IPoint p3 = glyph.GetNextPoint(poly, i);
+
+ if ((tool == TOOLAddPoly) && (poly == (glyph.GetNumPolys() - 1))
+ && (i == (glyph.GetNumPoints(poly) - 1)))
+ {
+ p3 = IPoint(addPoint.x, addPoint.y, addPointOnCurve);
+ p.SetPen(QPen(Qt::green, 1.0, Qt::SolidLine));
+ DrawGlyphSegment(p, p1, p2, p3);
+ p1 = p2;
+ p2 = p3;
+ p3 = glyph.GetNextPoint(poly, i);