summaryrefslogtreecommitdiffstats
path: root/src/pen-context.cpp
diff options
context:
space:
mode:
authorJabier Arraiza Cenoz <jabier.arraiza@marker.es>2013-08-09 11:47:56 +0000
committerJaviertxo <jtx@jtx.marker.es>2013-08-09 11:47:56 +0000
commit4e358f420a7a1512c722d9eccd864416bc4c075b (patch)
tree223e826158e09ab2c864abf0214fe1e6a714ab61 /src/pen-context.cpp
parentUpdate to trunk (diff)
parentRemove missing files from POTFILES.in (diff)
downloadinkscape-4e358f420a7a1512c722d9eccd864416bc4c075b.tar.gz
inkscape-4e358f420a7a1512c722d9eccd864416bc4c075b.zip
update to trunk
(bzr r11950.1.127)
Diffstat (limited to 'src/pen-context.cpp')
-rw-r--r--src/pen-context.cpp13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/pen-context.cpp b/src/pen-context.cpp
index df5fdadb9..6f51d59cb 100644
--- a/src/pen-context.cpp
+++ b/src/pen-context.cpp
@@ -21,7 +21,6 @@
#include <string>
#include "pen-context.h"
#include "sp-namedview.h"
-#include "sp-metrics.h"
#include "desktop.h"
#include "desktop-handles.h"
#include "selection.h"
@@ -38,7 +37,6 @@
#include "display/sp-ctrlline.h"
#include "display/sodipodi-ctrl.h"
#include <glibmm/i18n.h>
-#include "helper/units.h"
#include "macros.h"
#include "context-fns.h"
#include "tools-switch.h"
@@ -1442,11 +1440,16 @@ static void spdc_pen_set_angle_distance_status_message(SPPenContext *const pc, G
SPDesktop *desktop = SP_EVENT_CONTEXT(pc)->desktop;
Geom::Point rel = p - pc->p[pc_point_to_compare];
- GString *dist = SP_PX_TO_METRIC_STRING(Geom::L2(rel), desktop->namedview->getDefaultMetric());
+ Inkscape::Util::Quantity q = Inkscape::Util::Quantity(Geom::L2(rel), "px");
+ GString *dist = g_string_new(q.string(*desktop->namedview->doc_units).c_str());
double angle = atan2(rel[Geom::Y], rel[Geom::X]) * 180 / M_PI;
Inkscape::Preferences *prefs = Inkscape::Preferences::get();
- if (prefs->getBool("/options/compassangledisplay/value", 0) != 0)
- angle = angle_to_compass (angle);
+ if (prefs->getBool("/options/compassangledisplay/value", 0) != 0) {
+ angle = 90 - angle;
+ if (angle < 0) {
+ angle += 360;
+ }
+ }
pc->_message_context->setF(Inkscape::IMMEDIATE_MESSAGE, message, angle, dist->str);
g_string_free(dist, FALSE);