aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/items/qquickimagebase_p_p.h
diff options
context:
space:
mode:
authorEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>2014-09-16 13:34:15 +0200
committerEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>2014-09-16 13:42:23 +0200
commitcc8a76ce8ea76afe912902067e95ca2abf9e482f (patch)
tree53aab4c7b7cfad5533738c9605c7f2869b825cac /src/quick/items/qquickimagebase_p_p.h
parent0e3f52de17e92fb83307dafe132363a57ce30941 (diff)
Fix crash when borders exceed item width/height in border image
While we protected against the the borders exceeding the size of the source image when deciding whether to create a given patch, we did not protect against the case where the target rectangle is smaller than the borders. To fix this, we simply move the calculation of the target rectangle up to before we create the nodes, and check for isEmpty() before creating the nodes. In addition, we did not properly handle changing the borders dynamically. The subtree has to be rebuilt if the borders change so that the source or target rectangles change. Change-Id: Ia6a0df616ebbd0a32924de0b63fd48043027930a Task-number: QTBUG-41338 Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
Diffstat (limited to 'src/quick/items/qquickimagebase_p_p.h')
-rw-r--r--src/quick/items/qquickimagebase_p_p.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/quick/items/qquickimagebase_p_p.h b/src/quick/items/qquickimagebase_p_p.h
index f30eacb4ac..ec2f0bb73e 100644
--- a/src/quick/items/qquickimagebase_p_p.h
+++ b/src/quick/items/qquickimagebase_p_p.h
@@ -75,6 +75,8 @@ public:
QSize sourcesize;
QSize oldSourceSize;
qreal devicePixelRatio;
+ QRectF oldInnerSourceRect;
+ QRectF oldInnerTargetRect;
bool async : 1;
bool cache : 1;
bool mirror: 1;