diff options
| author | Alvin Penner <penner@vaxxine.com> | 2015-03-04 13:48:54 +0000 |
|---|---|---|
| committer | apenner <penner@vaxxine.com> | 2015-03-04 13:48:54 +0000 |
| commit | aa051f8b327c54c75d9f8b9ebffabf0aa92af8d8 (patch) | |
| tree | 8f70ca3a4d56b1643f2f62dc1faf57a15a2a4447 /src | |
| parent | Extensions. Fix for Bug #1426684 (INX optiongroup does not trigger a refresh). (diff) | |
| download | inkscape-aa051f8b327c54c75d9f8b9ebffabf0aa92af8d8.tar.gz inkscape-aa051f8b327c54c75d9f8b9ebffabf0aa92af8d8.zip | |
scale spinboxes for rectangle toolbar. (Bug 307656)
Fixed bugs:
- https://launchpad.net/bugs/307656
(bzr r13964)
Diffstat (limited to 'src')
| -rw-r--r-- | src/sp-rect.cpp | 16 | ||||
| -rw-r--r-- | src/widgets/rect-toolbar.cpp | 11 |
2 files changed, 13 insertions, 14 deletions
diff --git a/src/sp-rect.cpp b/src/sp-rect.cpp index 361d3c8c0..30571a8dd 100644 --- a/src/sp-rect.cpp +++ b/src/sp-rect.cpp @@ -342,7 +342,7 @@ void SPRect::setVisibleRx(gdouble rx) { this->rx.computed = rx / SPRect::vectorStretch( Geom::Point(this->x.computed + 1, this->y.computed), Geom::Point(this->x.computed, this->y.computed), - this->transform); + this->i2doc_affine()); this->rx._set = true; } @@ -358,7 +358,7 @@ void SPRect::setVisibleRy(gdouble ry) { this->ry.computed = ry / SPRect::vectorStretch( Geom::Point(this->x.computed, this->y.computed + 1), Geom::Point(this->x.computed, this->y.computed), - this->transform); + this->i2doc_affine()); this->ry._set = true; } @@ -374,7 +374,7 @@ gdouble SPRect::getVisibleRx() const { return this->rx.computed * SPRect::vectorStretch( Geom::Point(this->x.computed + 1, this->y.computed), Geom::Point(this->x.computed, this->y.computed), - this->transform); + this->i2doc_affine()); } gdouble SPRect::getVisibleRy() const { @@ -385,7 +385,7 @@ gdouble SPRect::getVisibleRy() const { return this->ry.computed * SPRect::vectorStretch( Geom::Point(this->x.computed, this->y.computed + 1), Geom::Point(this->x.computed, this->y.computed), - this->transform); + this->i2doc_affine()); } Geom::Rect SPRect::getRect() const { @@ -436,7 +436,7 @@ void SPRect::setVisibleWidth(gdouble width) { this->width.computed = width / SPRect::vectorStretch( Geom::Point(this->x.computed + 1, this->y.computed), Geom::Point(this->x.computed, this->y.computed), - this->transform); + this->i2doc_affine()); this->width._set = true; this->updateRepr(); @@ -446,7 +446,7 @@ void SPRect::setVisibleHeight(gdouble height) { this->height.computed = height / SPRect::vectorStretch( Geom::Point(this->x.computed, this->y.computed + 1), Geom::Point(this->x.computed, this->y.computed), - this->transform); + this->i2doc_affine()); this->height._set = true; this->updateRepr(); @@ -460,7 +460,7 @@ gdouble SPRect::getVisibleWidth() const { return this->width.computed * SPRect::vectorStretch( Geom::Point(this->x.computed + 1, this->y.computed), Geom::Point(this->x.computed, this->y.computed), - this->transform); + this->i2doc_affine()); } gdouble SPRect::getVisibleHeight() const { @@ -471,7 +471,7 @@ gdouble SPRect::getVisibleHeight() const { return this->height.computed * SPRect::vectorStretch( Geom::Point(this->x.computed, this->y.computed + 1), Geom::Point(this->x.computed, this->y.computed), - this->transform); + this->i2doc_affine()); } void SPRect::snappoints(std::vector<Inkscape::SnapCandidatePoint> &p, Inkscape::SnapPreferences const *snapprefs) const { diff --git a/src/widgets/rect-toolbar.cpp b/src/widgets/rect-toolbar.cpp index c2134b10c..46f6d1c23 100644 --- a/src/widgets/rect-toolbar.cpp +++ b/src/widgets/rect-toolbar.cpp @@ -109,7 +109,7 @@ static void sp_rtb_value_changed(GtkAdjustment *adj, GObject *tbl, gchar const * for (GSList const *items = selection->itemList(); items != NULL; items = items->next) { if (SP_IS_RECT(items->data)) { if (gtk_adjustment_get_value(adj) != 0) { - (SP_RECT(items->data)->*setter)(Quantity::convert(gtk_adjustment_get_value(adj), unit, desktop->getNamedView()->svg_units)); + (SP_RECT(items->data)->*setter)(Quantity::convert(gtk_adjustment_get_value(adj), unit, "px")); } else { SP_OBJECT(items->data)->getRepr()->setAttribute(value_name, NULL); } @@ -181,7 +181,6 @@ 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 *svg_unit = SP_ACTIVE_DESKTOP->getNamedView()->svg_units; g_return_if_fail(unit != NULL); gpointer item = g_object_get_data( tbl, "item" ); @@ -190,28 +189,28 @@ static void rect_tb_event_attr_changed(Inkscape::XML::Node * /*repr*/, gchar con GtkAdjustment *adj = GTK_ADJUSTMENT( g_object_get_data( tbl, "rx" ) ); gdouble rx = SP_RECT(item)->getVisibleRx(); - gtk_adjustment_set_value(adj, Quantity::convert(rx, svg_unit, unit)); + gtk_adjustment_set_value(adj, Quantity::convert(rx, "px", unit)); } { GtkAdjustment *adj = GTK_ADJUSTMENT( g_object_get_data( tbl, "ry" ) ); gdouble ry = SP_RECT(item)->getVisibleRy(); - gtk_adjustment_set_value(adj, Quantity::convert(ry, svg_unit, unit)); + gtk_adjustment_set_value(adj, Quantity::convert(ry, "px", unit)); } { GtkAdjustment *adj = GTK_ADJUSTMENT( g_object_get_data( tbl, "width" ) ); gdouble width = SP_RECT(item)->getVisibleWidth(); - gtk_adjustment_set_value(adj, Quantity::convert(width, svg_unit, unit)); + gtk_adjustment_set_value(adj, Quantity::convert(width, "px", unit)); } { GtkAdjustment *adj = GTK_ADJUSTMENT( g_object_get_data( tbl, "height" ) ); gdouble height = SP_RECT(item)->getVisibleHeight(); - gtk_adjustment_set_value(adj, Quantity::convert(height, svg_unit, unit)); + gtk_adjustment_set_value(adj, Quantity::convert(height, "px", unit)); } } |
