src/editmodes/abstractEditMode.cc

changeset 866
4951b737f8cb
parent 861
83426c5fa732
child 874
ba75c789667e
--- a/src/editmodes/abstractEditMode.cc	Sat Aug 30 16:08:05 2014 +0300
+++ b/src/editmodes/abstractEditMode.cc	Sat Aug 30 20:09:30 2014 +0300
@@ -174,7 +174,8 @@
 	m_drawedVerts.clear();
 }
 
-void AbstractDrawMode::renderPolygon (QPainter& painter, const QVector<Vertex>& poly3d, bool withangles) const
+void AbstractDrawMode::renderPolygon (QPainter& painter, const QVector<Vertex>& poly3d,
+	bool withlengths, bool withangles) const
 {
 	QVector<QPoint> poly (poly3d.size());
 	QFontMetrics metrics = QFontMetrics (QFont());
@@ -200,7 +201,7 @@
 	}
 
 	// Draw line lenghts and angle info if appropriate
-	if (poly3d.size() >= 2)
+	if (poly3d.size() >= 2 and (withlengths or withangles))
 	{
 		painter.setPen (renderer()->textPen());
 
@@ -209,7 +210,7 @@
 			const int j = (i + 1) % poly3d.size();
 			const int h = (i - 1 >= 0) ? (i - 1) : (poly3d.size() - 1);
 
-			if (cfg::DrawLineLengths)
+			if (withlengths and cfg::DrawLineLengths)
 			{
 				const QString label = QString::number ((poly3d[j] - poly3d[i]).length());
 				QPoint origin = QLineF (poly[i], poly[j]).pointAt (0.5).toPoint();

mercurial