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 /* |