diff options
| author | Jabier Arraiza Cenoz <jabier.arraiza@marker.es> | 2013-08-09 11:47:56 +0000 |
|---|---|---|
| committer | Javiertxo <jtx@jtx.marker.es> | 2013-08-09 11:47:56 +0000 |
| commit | 4e358f420a7a1512c722d9eccd864416bc4c075b (patch) | |
| tree | 223e826158e09ab2c864abf0214fe1e6a714ab61 /src/ui/tool/node.cpp | |
| parent | Update to trunk (diff) | |
| parent | Remove missing files from POTFILES.in (diff) | |
| download | inkscape-4e358f420a7a1512c722d9eccd864416bc4c075b.tar.gz inkscape-4e358f420a7a1512c722d9eccd864416bc4c075b.zip | |
update to trunk
(bzr r11950.1.127)
Diffstat (limited to 'src/ui/tool/node.cpp')
| -rw-r--r-- | src/ui/tool/node.cpp | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/src/ui/tool/node.cpp b/src/ui/tool/node.cpp index 89a0f4163..5f5757a14 100644 --- a/src/ui/tool/node.cpp +++ b/src/ui/tool/node.cpp @@ -21,7 +21,6 @@ #include "preferences.h" #include "snap.h" #include "snap-preferences.h" -#include "sp-metrics.h" #include "sp-namedview.h" #include "ui/control-manager.h" #include "ui/tool/control-point-selection.h" @@ -610,9 +609,13 @@ Glib::ustring Handle::_getDragTip(GdkEventMotion */*event*/) const double angle = Geom::angle_between(Geom::Point(-1,0), position() - _parent->position()); angle += M_PI; // angle is (-M_PI...M_PI] - offset by +pi and scale to 0...360 angle *= 360.0 / (2 * M_PI); - GString *x = SP_PX_TO_METRIC_STRING(dist[Geom::X], _desktop->namedview->getDefaultMetric()); - GString *y = SP_PX_TO_METRIC_STRING(dist[Geom::Y], _desktop->namedview->getDefaultMetric()); - GString *len = SP_PX_TO_METRIC_STRING(length(), _desktop->namedview->getDefaultMetric()); + + Inkscape::Util::Quantity x_q = Inkscape::Util::Quantity(dist[Geom::X], "px"); + Inkscape::Util::Quantity y_q = Inkscape::Util::Quantity(dist[Geom::Y], "px"); + Inkscape::Util::Quantity len_q = Inkscape::Util::Quantity(length(), "px"); + GString *x = g_string_new(x_q.string(*_desktop->namedview->doc_units).c_str()); + GString *y = g_string_new(y_q.string(*_desktop->namedview->doc_units).c_str()); + GString *len = g_string_new(len_q.string(*_desktop->namedview->doc_units).c_str()); Glib::ustring ret = format_tip(C_("Path handle tip", "Move handle by %s, %s; angle %.2f°, length %s"), x->str, y->str, angle, len->str); g_string_free(x, TRUE); @@ -1461,8 +1464,11 @@ Glib::ustring Node::_getTip(unsigned state) const Glib::ustring Node::_getDragTip(GdkEventMotion */*event*/) const { Geom::Point dist = position() - _last_drag_origin(); - GString *x = SP_PX_TO_METRIC_STRING(dist[Geom::X], _desktop->namedview->getDefaultMetric()); - GString *y = SP_PX_TO_METRIC_STRING(dist[Geom::Y], _desktop->namedview->getDefaultMetric()); + + Inkscape::Util::Quantity x_q = Inkscape::Util::Quantity(dist[Geom::X], "px"); + Inkscape::Util::Quantity y_q = Inkscape::Util::Quantity(dist[Geom::Y], "px"); + GString *x = g_string_new(x_q.string(*_desktop->namedview->doc_units).c_str()); + GString *y = g_string_new(y_q.string(*_desktop->namedview->doc_units).c_str()); Glib::ustring ret = format_tip(C_("Path node tip", "Move node by %s, %s"), x->str, y->str); g_string_free(x, TRUE); |
