summaryrefslogtreecommitdiffstats
path: root/src/sp-mesh-array.cpp
diff options
context:
space:
mode:
authorTavmjong Bah <tavmjong@free.fr>2016-11-12 13:14:55 +0000
committertavmjong-free <tavmjong@free.fr>2016-11-12 13:14:55 +0000
commit2189e04b47b098cb2f6937fe7c66f734750406d9 (patch)
treee544cf8c8f3e04ef5c24411cbe54828290f4684f /src/sp-mesh-array.cpp
parentupdate potfile (diff)
downloadinkscape-2189e04b47b098cb2f6937fe7c66f734750406d9.tar.gz
inkscape-2189e04b47b098cb2f6937fe7c66f734750406d9.zip
Fit to bounding box: correct transform when mesh has a non-identity gradient transform.
(bzr r15243)
Diffstat (limited to 'src/sp-mesh-array.cpp')
-rw-r--r--src/sp-mesh-array.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/sp-mesh-array.cpp b/src/sp-mesh-array.cpp
index 107359c6c..565551fd4 100644
--- a/src/sp-mesh-array.cpp
+++ b/src/sp-mesh-array.cpp
@@ -2761,6 +2761,15 @@ void SPMeshNodeArray::transform(Geom::Affine const &m) {
// Transform mesh to fill box. Return true if mesh transformed.
bool SPMeshNodeArray::fill_box(Geom::OptRect &box) {
+ // If gradientTransfor is set (as happens when an object is transformed
+ // with the "optimized" preferences set true), we need to remove it.
+ if (mg->gradientTransform_set) {
+ Geom::Affine gt = mg->gradientTransform;
+ transform( gt );
+ mg->gradientTransform_set = false;
+ mg->gradientTransform.setIdentity();
+ }
+
SPCurve *outline = outline_path();
Geom::OptRect mesh_bbox = outline->get_pathvector().boundsExact();
outline->unref();