From bbd8b0f98d6e24e18f7bede94bf549ed126b9cd4 Mon Sep 17 00:00:00 2001 From: Nathan Lee <2431820-nathanal@users.noreply.gitlab.com> Date: Thu, 31 Oct 2019 09:38:59 +1100 Subject: Fix initial transform of shape in opened file. Fix https://gitlab.com/inkscape/inkscape/issues/495 and likely other problems. --- src/object/sp-shape.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/object/sp-shape.cpp b/src/object/sp-shape.cpp index c186b176c..be68aae1f 100644 --- a/src/object/sp-shape.cpp +++ b/src/object/sp-shape.cpp @@ -467,7 +467,10 @@ Geom::OptRect SPShape::bbox(Geom::Affine const &transform, SPItem::BBoxType bbox // the cache doesn't get called if the object is moved, so we need // to compare the transformations as well. bool cached = (bboxtype == SPItem::VISUAL_BBOX) ? bbox_vis_cache_is_valid : bbox_geom_cache_is_valid; - if (cached && transform == bbox_transform_cache) { + if (transform != bbox_transform_cache) { + bbox_vis_cache_is_valid = false; + bbox_geom_cache_is_valid = false; + } else if (cached) { return (bboxtype == SPItem::VISUAL_BBOX) ? bbox_vis_cache : bbox_geom_cache; } -- cgit v1.2.3