diff options
| author | Diederik van Lierop <mail@diedenrezi.nl> | 2007-04-30 22:44:35 +0000 |
|---|---|---|
| committer | dvlierop2 <dvlierop2@users.sourceforge.net> | 2007-04-30 22:44:35 +0000 |
| commit | f707fb5d87ce216ecbf9c19e8429b32258268d55 (patch) | |
| tree | 3eeb9c395b539d62b666218e306e62a7477a7c86 /src/seltrans.cpp | |
| parent | Committed patch 1710210 from John Faith (diff) | |
| download | inkscape-f707fb5d87ce216ecbf9c19e8429b32258268d55.tar.gz inkscape-f707fb5d87ce216ecbf9c19e8429b32258268d55.zip | |
Fix bug #1077600 -> correct mirroring and no drifting of origin
(bzr r2971)
Diffstat (limited to 'src/seltrans.cpp')
| -rw-r--r-- | src/seltrans.cpp | 22 |
1 files changed, 6 insertions, 16 deletions
diff --git a/src/seltrans.cpp b/src/seltrans.cpp index cfc784dac..9c874c242 100644 --- a/src/seltrans.cpp +++ b/src/seltrans.cpp @@ -1338,22 +1338,17 @@ void Inkscape::SelTrans::stretch(SPSelTransHandle const &handle, NR::Point &pt, return; } - //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 corners 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])); + 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)); int transform_stroke = false; gdouble strokewidth = 0; - + if ( _snap_bbox_type != SPItem::GEOMETRIC_BBOX) { transform_stroke = prefs_get_int_attribute ("options.transform", "stroke", 1); strokewidth = _strokewidth; } - + NR::Matrix scaler = get_scale_transform_with_stroke (*_approximate_bbox, strokewidth, transform_stroke, new_bbox_min[NR::X], new_bbox_min[NR::Y], new_bbox_max[NR::X], new_bbox_max[NR::Y]); @@ -1376,13 +1371,8 @@ void Inkscape::SelTrans::scale(NR::Point &pt, guint state) s[i] = 1e-9; } - //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 corners 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])); + 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)); int transform_stroke = false; gdouble strokewidth = 0; |
