summaryrefslogtreecommitdiffstats
path: root/src/ui/tools/measure-tool.cpp
diff options
context:
space:
mode:
authorJabier Arraiza Cenoz <jabier.arraiza@marker.es>2015-10-06 17:14:44 +0000
committerjabiertxof <jabier.arraiza@marker.es>2015-10-06 17:14:44 +0000
commit98b86a476c3b26d341a4c175d90bc5611b0899cf (patch)
tree3f48a60c7c6800d702721a80e7f593867bc9f323 /src/ui/tools/measure-tool.cpp
parentfix a bug on snapping with start knot (diff)
downloadinkscape-98b86a476c3b26d341a4c175d90bc5611b0899cf.tar.gz
inkscape-98b86a476c3b26d341a4c175d90bc5611b0899cf.zip
fix a bug rendering the angle line in diferent units than pixels
(bzr r14393.1.11)
Diffstat (limited to 'src/ui/tools/measure-tool.cpp')
-rw-r--r--src/ui/tools/measure-tool.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/ui/tools/measure-tool.cpp b/src/ui/tools/measure-tool.cpp
index 894687919..8a9340b07 100644
--- a/src/ui/tools/measure-tool.cpp
+++ b/src/ui/tools/measure-tool.cpp
@@ -190,12 +190,14 @@ Geom::Point calcAngleDisplayAnchor(SPDesktop *desktop, double angle, double base
* @param anchor the anchor point for displaying the text label.
* @param angle the angle of the arc segment to draw.
*/
-void createAngleDisplayCurve(SPDesktop *desktop, Geom::Point const &center, Geom::Point const &end, Geom::Point const &anchor, double angle)
+void createAngleDisplayCurve(SPDesktop *desktop, Geom::Point const &center, Geom::Point const &end, Geom::Point const &anchor, double angle, Glib::ustring unit_name)
{
// Given that we have a point on the arc's edge and the angle of the arc, we need to get the two endpoints.
double textLen = std::abs((anchor - center).length());
+ textLen = Inkscape::Util::Quantity::convert(textLen, "px", unit_name);
double sideLen = std::abs((end - center).length());
+ sideLen = Inkscape::Util::Quantity::convert(sideLen, "px", unit_name);
if (sideLen > 0.0) {
double factor = std::min(1.0, textLen / sideLen);
@@ -877,7 +879,7 @@ void MeasureTool::showCanvasItems(Geom::Point start_point, Geom::Point end_point
CTLINE_SECONDARY);
measure_tmp_items.push_back(desktop->add_temporary_canvasitem(control_line, 0));
- createAngleDisplayCurve(desktop, start_point, end_point, angleDisplayPt, angle);
+ createAngleDisplayCurve(desktop, start_point, end_point, angleDisplayPt, angle, unit_name);
}
}