Code

Patch by Johan to fix 391368
[inkscape.git] / src / sp-item-transform.cpp
index 3b0b1e054d7dc4109632374ab7ce762272bf0600..23c0bdf33bd0cc544c172ed8f0c335c6343a5785 100644 (file)
@@ -32,13 +32,14 @@ sp_item_rotate_rel(SPItem *item, Geom::Rotate const &rotation)
     // Restore the center position (it's changed because the bbox center changed)
     if (item->isCenterSet()) {
         item->setCenter(center * affine);
+        item->updateRepr();
     }
 }
 
 void
 sp_item_scale_rel (SPItem *item, Geom::Scale const &scale)
 {
-    boost::optional<Geom::Rect> bbox = sp_item_bbox_desktop(item);
+    Geom::OptRect bbox = sp_item_bbox_desktop(item);
     if (bbox) {
         Geom::Translate const s(bbox->midpoint()); // use getCenter?
         sp_item_set_i2d_affine(item, sp_item_i2d_affine(item) * s.inverse() * scale * s);
@@ -61,6 +62,7 @@ sp_item_skew_rel (SPItem *item, double skewX, double skewY)
     // Restore the center position (it's changed because the bbox center changed)
     if (item->isCenterSet()) {
         item->setCenter(center * affine);
+        item->updateRepr();
     }
 }
 
@@ -95,7 +97,7 @@ get_scale_transform_with_stroke (Geom::Rect const &bbox_param, gdouble strokewid
     gdouble h1 = y1 - y0;
     gdouble r0 = strokewidth;
 
-    if (bbox.isEmpty()) {
+    if (bbox.hasZeroArea()) {
         Geom::Matrix move = Geom::Translate(x0 - bbox.min()[Geom::X], y0 - bbox.min()[Geom::Y]);
         return (move); // cannot scale from empty boxes at all, so only translate
     }
@@ -158,7 +160,7 @@ get_scale_transform_with_stroke (Geom::Rect const &bbox_param, gdouble strokewid
 }
 
 Geom::Rect
-get_visual_bbox (boost::optional<Geom::Rect> const &initial_geom_bbox, Geom::Matrix const &abs_affine, gdouble const initial_strokewidth, bool const transform_stroke)
+get_visual_bbox (Geom::OptRect const &initial_geom_bbox, Geom::Matrix const &abs_affine, gdouble const initial_strokewidth, bool const transform_stroke)
 {
     
     g_assert(initial_geom_bbox);