diff options
| author | Matthew Petroff <matthew@mpetroff.net> | 2013-07-18 21:21:24 +0000 |
|---|---|---|
| committer | Matthew Petroff <matthew@mpetroff.net> | 2013-07-18 21:21:24 +0000 |
| commit | 3772fc428950b2b946a1bd7c7c97e06219c3165f (patch) | |
| tree | 672f1a63f086c8821e388ce62562f2fa969fdbc0 /src/widgets/node-toolbar.cpp | |
| parent | Added more more convientent unit functions. (diff) | |
| download | inkscape-3772fc428950b2b946a1bd7c7c97e06219c3165f.tar.gz inkscape-3772fc428950b2b946a1bd7c7c97e06219c3165f.zip | |
Switch unit functions from using pointer arguements to reference arguements.
(bzr r12380.1.28)
Diffstat (limited to 'src/widgets/node-toolbar.cpp')
| -rw-r--r-- | src/widgets/node-toolbar.cpp | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/src/widgets/node-toolbar.cpp b/src/widgets/node-toolbar.cpp index 50880f481..d60b58886 100644 --- a/src/widgets/node-toolbar.cpp +++ b/src/widgets/node-toolbar.cpp @@ -250,16 +250,15 @@ static void sp_node_toolbox_coord_changed(gpointer /*shape_editor*/, GObject *tb gtk_action_set_sensitive(xact, TRUE); gtk_action_set_sensitive(yact, TRUE); Inkscape::Util::UnitTable unit_table; - Unit px = unit_table.getUnit("px"); - Geom::Coord oldx = Quantity::convert(gtk_adjustment_get_value(xadj), &unit, &px); - Geom::Coord oldy = Quantity::convert(gtk_adjustment_get_value(yadj), &unit, &px); + Geom::Coord oldx = Quantity::convert(gtk_adjustment_get_value(xadj), unit, "px"); + Geom::Coord oldy = Quantity::convert(gtk_adjustment_get_value(yadj), unit, "px"); Geom::Point mid = nt->_selected_nodes->pointwiseBounds()->midpoint(); if (oldx != mid[Geom::X]) { - gtk_adjustment_set_value(xadj, Quantity::convert(mid[Geom::X], &px, &unit)); + gtk_adjustment_set_value(xadj, Quantity::convert(mid[Geom::X], "px", unit)); } if (oldy != mid[Geom::Y]) { - gtk_adjustment_set_value(yadj, Quantity::convert(mid[Geom::Y], &px, &unit)); + gtk_adjustment_set_value(yadj, Quantity::convert(mid[Geom::Y], "px", unit)); } } @@ -278,11 +277,10 @@ static void sp_node_path_value_changed(GtkAdjustment *adj, GObject *tbl, Geom::D Unit const unit = tracker->getActiveUnit(); Inkscape::Util::UnitTable unit_table; - Unit px = unit_table.getUnit("px"); if (DocumentUndo::getUndoSensitive(sp_desktop_document(desktop))) { prefs->setDouble(Glib::ustring("/tools/nodes/") + (d == Geom::X ? "x" : "y"), - Quantity::convert(gtk_adjustment_get_value(adj), &unit, &px)); + Quantity::convert(gtk_adjustment_get_value(adj), unit, "px")); } // quit if run by the attr_changed listener @@ -295,7 +293,7 @@ static void sp_node_path_value_changed(GtkAdjustment *adj, GObject *tbl, Geom::D InkNodeTool *nt = get_node_tool(); if (nt && !nt->_selected_nodes->empty()) { - double val = Quantity::convert(gtk_adjustment_get_value(adj), &unit, &px); + double val = Quantity::convert(gtk_adjustment_get_value(adj), unit, "px"); double oldval = nt->_selected_nodes->pointwiseBounds()->midpoint()[d]; Geom::Point delta(0,0); delta[d] = val - oldval; |
