X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=src%2Fui%2Fdialog%2Ftransformation.cpp;h=8fa2c5dcb0b5c5733ba0b13559a90cf5d82e9264;hb=89e8568d5ae16cfde63d3065a38dc46c6601b62c;hp=6056e4a2e3043853692d50402f0513d3726ec4dc;hpb=a21718e01023e9f2e4bde918148a1f76fd9aa7a5;p=inkscape.git diff --git a/src/ui/dialog/transformation.cpp b/src/ui/dialog/transformation.cpp index 6056e4a2e..8fa2c5dcb 100644 --- a/src/ui/dialog/transformation.cpp +++ b/src/ui/dialog/transformation.cpp @@ -437,7 +437,7 @@ void Transformation::onSwitchPage(GtkNotebookPage *page, guint pagenum) { - updateSelection((PageType)pagenum, SP_DT_SELECTION(SP_ACTIVE_DESKTOP)); + updateSelection((PageType)pagenum, sp_desktop_selection(SP_ACTIVE_DESKTOP)); } void @@ -581,7 +581,7 @@ Transformation::applyPageMove(Inkscape::Selection *selection) x - bbox.min()[NR::X], y - bbox.min()[NR::Y]); } - sp_document_done ( SP_DT_DOCUMENT (selection->desktop()) ); + sp_document_done ( sp_desktop_document (selection->desktop()) ); } void @@ -613,7 +613,7 @@ Transformation::applyPageScale(Inkscape::Selection *selection) } } else { NR::Rect bbox(selection->bounds()); - NR::Point center(bbox.midpoint()); + NR::Point center(bbox.midpoint()); // use rotation center? NR::scale scale (0,0); // the values are increments! if (_units_scale.isAbsolute()) { @@ -632,7 +632,7 @@ Transformation::applyPageScale(Inkscape::Selection *selection) sp_selection_scale_relative(selection, center, scale); } - sp_document_done(SP_DT_DOCUMENT(selection->desktop())); + sp_document_done(sp_desktop_document(selection->desktop())); } void @@ -646,13 +646,11 @@ Transformation::applyPageRotate(Inkscape::Selection *selection) sp_item_rotate_rel(item, NR::rotate (angle*M_PI/180.0)); } } else { - NR::Rect bbox = selection->bounds(); - NR::Point center = bbox.midpoint(); + NR::Point center = selection->center(); sp_selection_rotate_relative(selection, center, angle); } - sp_document_done(SP_DT_DOCUMENT(selection->desktop())); - + sp_document_done(sp_desktop_document(selection->desktop())); } void @@ -685,7 +683,7 @@ Transformation::applyPageSkew(Inkscape::Selection *selection) NR::Rect bbox = selection->bounds(); double width = bbox.max()[NR::X] - bbox.min()[NR::X]; double height = bbox.max()[NR::Y] - bbox.min()[NR::Y]; - NR::Point center = bbox.midpoint(); + NR::Point center = selection->center(); if (!_units_skew.isAbsolute()) { // percentage double skewX = _scalar_skew_horizontal.getValue("%"); @@ -704,7 +702,7 @@ Transformation::applyPageSkew(Inkscape::Selection *selection) } } - sp_document_done(SP_DT_DOCUMENT(selection->desktop())); + sp_document_done(sp_desktop_document(selection->desktop())); } @@ -724,12 +722,13 @@ Transformation::applyPageTransform(Inkscape::Selection *selection) for (GSList const *l = selection->itemList(); l != NULL; l = l->next) { SPItem *item = SP_ITEM(l->data); sp_item_set_item_transform(item, displayed); + SP_OBJECT(item)->updateRepr(); } } else { sp_selection_apply_affine(selection, displayed); // post-multiply each object's transform } - sp_document_done(SP_DT_DOCUMENT(selection->desktop())); + sp_document_done(sp_desktop_document(selection->desktop())); }