aboutsummaryrefslogtreecommitdiffstats
path: root/tests/manual/scenegraph_lancelot/data
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 /tests/manual/scenegraph_lancelot/data
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 'tests/manual/scenegraph_lancelot/data')
-rw-r--r--tests/manual/scenegraph_lancelot/data/borderimages/borderimage_borders_exceed_height.qml32
-rw-r--r--tests/manual/scenegraph_lancelot/data/borderimages/borderimage_borders_exceed_width.qml32
2 files changed, 64 insertions, 0 deletions
diff --git a/tests/manual/scenegraph_lancelot/data/borderimages/borderimage_borders_exceed_height.qml b/tests/manual/scenegraph_lancelot/data/borderimages/borderimage_borders_exceed_height.qml
new file mode 100644
index 0000000000..c4321d25bb
--- /dev/null
+++ b/tests/manual/scenegraph_lancelot/data/borderimages/borderimage_borders_exceed_height.qml
@@ -0,0 +1,32 @@
+import QtQuick 2.2
+
+Rectangle {
+ width: 320
+ height: 480
+
+ color: "red"
+
+ Item {
+ x: 80
+ y: 80
+
+ BorderImage {
+ source: "../shared/world.png"
+
+ width: 10
+ height: 10
+
+ antialiasing: true
+
+ horizontalTileMode: BorderImage.Repeat
+ verticalTileMode: BorderImage.Repeat
+
+ smooth: false
+
+ border.bottom: 5
+ border.left: 0
+ border.right: 0
+ border.top: 5
+ }
+ }
+}
diff --git a/tests/manual/scenegraph_lancelot/data/borderimages/borderimage_borders_exceed_width.qml b/tests/manual/scenegraph_lancelot/data/borderimages/borderimage_borders_exceed_width.qml
new file mode 100644
index 0000000000..328ff40008
--- /dev/null
+++ b/tests/manual/scenegraph_lancelot/data/borderimages/borderimage_borders_exceed_width.qml
@@ -0,0 +1,32 @@
+import QtQuick 2.2
+
+Rectangle {
+ width: 320
+ height: 480
+
+ color: "red"
+
+ Item {
+ x: 80
+ y: 80
+
+ BorderImage {
+ source: "../shared/world.png"
+
+ width: 10
+ height: 10
+
+ antialiasing: true
+
+ horizontalTileMode: BorderImage.Repeat
+ verticalTileMode: BorderImage.Repeat
+
+ smooth: false
+
+ border.bottom: 0
+ border.left: 5
+ border.right: 5
+ border.top: 0
+ }
+ }
+}