src/editmodes/abstractEditMode.cpp

changeset 1431
2e0e2c696605
parent 1419
f7c53002a990
equal deleted inserted replaced
1430:6ce6d3da584f 1431:2e0e2c696605
208 void AbstractDrawMode::drawLineLength(QPainter &painter, const Vertex &v0, const Vertex &v1, const QPointF& v0p, const QPointF& v1p) const 208 void AbstractDrawMode::drawLineLength(QPainter &painter, const Vertex &v0, const Vertex &v1, const QPointF& v0p, const QPointF& v1p) const
209 { 209 {
210 if (not config::drawLineLengths()) 210 if (not config::drawLineLengths())
211 return; 211 return;
212 212
213 const QString label = QString::number(abs(v1 - v0), 'f', 2); 213 const QString label = QString::number((v1 - v0).length(), 'f', 2);
214 QPoint origin = QLineF {v0p, v1p}.pointAt(0.5).toPoint(); 214 QPoint origin = QLineF {v0p, v1p}.pointAt(0.5).toPoint();
215 painter.drawText (origin, label); 215 painter.drawText (origin, label);
216 } 216 }
217 217
218 /* 218 /*

mercurial