summaryrefslogtreecommitdiffstats
path: root/src/widgets/rect-toolbar.cpp
diff options
context:
space:
mode:
authorMatthew Petroff <matthew@mpetroff.net>2013-09-16 23:16:21 +0000
committerMatthew Petroff <matthew@mpetroff.net>2013-09-16 23:16:21 +0000
commit9395aebf3ad8f461c7ab2642a810a872d22cdeea (patch)
treee092e5f2ab0968ea682e5a420f8f75fc588ae6d5 /src/widgets/rect-toolbar.cpp
parentComment clean up. (diff)
downloadinkscape-9395aebf3ad8f461c7ab2642a810a872d22cdeea.tar.gz
inkscape-9395aebf3ad8f461c7ab2642a810a872d22cdeea.zip
Fix bug in rectangle toolbar.
(bzr r12475.1.28)
Diffstat (limited to 'src/widgets/rect-toolbar.cpp')
-rw-r--r--src/widgets/rect-toolbar.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/widgets/rect-toolbar.cpp b/src/widgets/rect-toolbar.cpp
index a830329cd..d67c4fc2f 100644
--- a/src/widgets/rect-toolbar.cpp
+++ b/src/widgets/rect-toolbar.cpp
@@ -115,7 +115,7 @@ static void sp_rtb_value_changed(GtkAdjustment *adj, GObject *tbl, gchar const *
if (SP_IS_RECT(items->data)) {
if (gtk_adjustment_get_value(adj) != 0) {
setter(SP_RECT(items->data),
- Quantity::convert(gtk_adjustment_get_value(adj), unit, "px"));
+ Quantity::convert(gtk_adjustment_get_value(adj), unit, *sp_desktop_namedview(desktop)->doc_units));
} else {
SP_OBJECT(items->data)->getRepr()->setAttribute(value_name, NULL);
}
@@ -187,31 +187,32 @@ static void rect_tb_event_attr_changed(Inkscape::XML::Node * /*repr*/, gchar con
UnitTracker* tracker = reinterpret_cast<UnitTracker*>( g_object_get_data( tbl, "tracker" ) );
Unit const unit = tracker->getActiveUnit();
+ Unit const doc_unit = *sp_desktop_namedview(SP_ACTIVE_DESKTOP)->doc_units;
gpointer item = g_object_get_data( tbl, "item" );
if (item && SP_IS_RECT(item)) {
{
GtkAdjustment *adj = GTK_ADJUSTMENT( g_object_get_data( tbl, "rx" ) );
gdouble rx = sp_rect_get_visible_rx(SP_RECT(item));
- gtk_adjustment_set_value(adj, Quantity::convert(rx, "px", unit));
+ gtk_adjustment_set_value(adj, Quantity::convert(rx, doc_unit, unit));
}
{
GtkAdjustment *adj = GTK_ADJUSTMENT( g_object_get_data( tbl, "ry" ) );
gdouble ry = sp_rect_get_visible_ry(SP_RECT(item));
- gtk_adjustment_set_value(adj, Quantity::convert(ry, "px", unit));
+ gtk_adjustment_set_value(adj, Quantity::convert(ry, doc_unit, unit));
}
{
GtkAdjustment *adj = GTK_ADJUSTMENT( g_object_get_data( tbl, "width" ) );
gdouble width = sp_rect_get_visible_width (SP_RECT(item));
- gtk_adjustment_set_value(adj, Quantity::convert(width, "px", unit));
+ gtk_adjustment_set_value(adj, Quantity::convert(width, doc_unit, unit));
}
{
GtkAdjustment *adj = GTK_ADJUSTMENT( g_object_get_data( tbl, "height" ) );
gdouble height = sp_rect_get_visible_height (SP_RECT(item));
- gtk_adjustment_set_value(adj, Quantity::convert(height, "px", unit));
+ gtk_adjustment_set_value(adj, Quantity::convert(height, doc_unit, unit));
}
}