[fondue-commits] [SCM] Fondue Font Editor branch, master, updated. 097b323e15f08ea5e8c1070c59c211e384fc8003

Eugeniy Meshcheryakov eugen at debian.org
Thu May 15 18:58:03 UTC 2008


The following commit has been merged in the master branch:
commit 435e9e946a2d50e8d0e319aef2ddbfbd2ce9a610
Author: Eugeniy Meshcheryakov <eugen at debian.org>
Date:   Thu May 15 17:18:48 2008 +0200

    display added contours

diff --git a/gui/glyphgraphics.cxx b/gui/glyphgraphics.cxx
index 253616f..7bbc55f 100644
--- a/gui/glyphgraphics.cxx
+++ b/gui/glyphgraphics.cxx
@@ -39,13 +39,7 @@ GlyphGraphics::GlyphGraphics(GlyphCell *parent, Glyph *glyph) :
 		if (v->type() == GlyphContentBase::Contour) {
 			GlyphContour *c = qobject_cast<GlyphContour *>(v);
 			Q_ASSERT(c);
-
-			for (int j = 0; j < c->points().size(); j++) {
-				ControlPoint *cp = new ControlPoint(c, j, item);
-				points.append(cp);
-			}
-			connect(c, SIGNAL(pointsAdded(int, int)), this, SLOT(contourPointsAdded(int, int)));
-			connect(c, SIGNAL(pointsAboutToBeRemoved(int, int)), this, SLOT(contourPointsAboutToBeRemoved(int, int)));
+			insertContour(c);
 		}
 		else {
 			// TODO make it useable
@@ -63,6 +57,7 @@ GlyphGraphics::GlyphGraphics(GlyphCell *parent, Glyph *glyph) :
 		}
 	}
 	p->scene()->addItem(item);
+	connect(m_glyph, SIGNAL(contourAdded(int)), this, SLOT(contourAdded(int)));
 }
 
 GlyphGraphics::GlyphGraphics(GlyphGraphics *parent, Glyph *glyph, const QPointF &pos) :
@@ -178,3 +173,21 @@ void GlyphGraphics::contourPointsAboutToBeRemoved(int start, int end)
 		}
 	}
 }
+
+void GlyphGraphics::contourAdded(int id)
+{
+	GlyphContour *contour = qobject_cast<GlyphContour *>(m_glyph->content().at(id));
+	Q_ASSERT(contour);
+	insertContour(contour);
+}
+
+void GlyphGraphics::insertContour(GlyphContour *contour)
+{
+	Q_ASSERT(contour);
+	for (int j = 0; j < contour->points().size(); j++) {
+		ControlPoint *cp = new ControlPoint(contour, j, item);
+		points.append(cp);
+	}
+	connect(contour, SIGNAL(pointsAdded(int, int)), this, SLOT(contourPointsAdded(int, int)));
+	connect(contour, SIGNAL(pointsAboutToBeRemoved(int, int)), this, SLOT(contourPointsAboutToBeRemoved(int, int)));
+}
diff --git a/gui/glyphgraphics.h b/gui/glyphgraphics.h
index 023f505..b258dde 100644
--- a/gui/glyphgraphics.h
+++ b/gui/glyphgraphics.h
@@ -37,8 +37,11 @@ public:
 public slots:
 	void contourPointsAdded(int start, int end);
 	void contourPointsAboutToBeRemoved(int start, int end);
+	void contourAdded(int id);
 private:
 	GlyphGraphics(GlyphGraphics *parent, Glyph *glyph, const QPointF &pos);
+	void insertContour(GlyphContour *contour);
+
 	GlyphCell *p;
 	Glyph *m_glyph;
 	QList<ControlPoint *> points;

-- 
Fondue Font Editor



More information about the fondue-commits mailing list