summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 1ed1764)
raw | patch | inline | side by side (parent: 1ed1764)
author | dvlierop2 <dvlierop2@users.sourceforge.net> | |
Mon, 9 Apr 2007 12:50:25 +0000 (12:50 +0000) | ||
committer | dvlierop2 <dvlierop2@users.sourceforge.net> | |
Mon, 9 Apr 2007 12:50:25 +0000 (12:50 +0000) |
src/seltrans.cpp | patch | blob | history |
diff --git a/src/seltrans.cpp b/src/seltrans.cpp
index 52afc0e1484a14e9fed0c49420d2ba459ffdb3da..21b8a046131aa7115ee12c83fb5a1545d039c115 100644 (file)
--- a/src/seltrans.cpp
+++ b/src/seltrans.cpp
@@ -1355,8 +1355,13 @@ void Inkscape::SelTrans::stretch(SPSelTransHandle const &handle, NR::Point &pt,
return;
}
- NR::Point new_bbox_min = _approximate_bbox->min() * (NR::translate(-scale_origin) * NR::Matrix(s) * NR::translate(scale_origin));
- NR::Point new_bbox_max = _approximate_bbox->max() * (NR::translate(-scale_origin) * NR::Matrix(s) * NR::translate(scale_origin));
+ //Get two corners of the new bbox
+ NR::Point p1 = _approximate_bbox->min() * (NR::translate(-scale_origin) * NR::Matrix(s) * NR::translate(scale_origin));
+ NR::Point p2 = _approximate_bbox->max() * (NR::translate(-scale_origin) * NR::Matrix(s) * NR::translate(scale_origin));
+
+ //Find the ones at the lower-left and upper-right, as required by get_scale_transform_with_stroke
+ NR::Point new_bbox_min = NR::Point(std::min(p1[NR::X], p2[NR::X]), std::min(p1[NR::Y], p2[NR::Y]));
+ NR::Point new_bbox_max = NR::Point(std::max(p1[NR::X], p2[NR::X]), std::max(p1[NR::Y], p2[NR::Y]));
int transform_stroke = false;
gdouble strokewidth = 0;
if (fabs(s[i]) < 1e-9)
s[i] = 1e-9;
}
- NR::Point new_bbox_min = _approximate_bbox->min() * (NR::translate(-_origin) * NR::Matrix(s) * NR::translate(_origin));
- NR::Point new_bbox_max = _approximate_bbox->max() * (NR::translate(-_origin) * NR::Matrix(s) * NR::translate(_origin));
+
+ //Get two corners of the new bbox
+ NR::Point p1 = _approximate_bbox->min() * (NR::translate(-_origin) * NR::Matrix(s) * NR::translate(_origin));
+ NR::Point p2 = _approximate_bbox->max() * (NR::translate(-_origin) * NR::Matrix(s) * NR::translate(_origin));
+ //Find the ones at the lower-left and upper-right, as required by get_scale_transform_with_stroke
+ NR::Point new_bbox_min = NR::Point(std::min(p1[NR::X], p2[NR::X]), std::min(p1[NR::Y], p2[NR::Y]));
+ NR::Point new_bbox_max = NR::Point(std::max(p1[NR::X], p2[NR::X]), std::max(p1[NR::Y], p2[NR::Y]));
+
int transform_stroke = false;
gdouble strokewidth = 0;