summaryrefslogtreecommitdiff
path: root/tests/manual/testbed/PositionPicker.qml
diff options
context:
space:
mode:
authorAlexey Andriyashin <alexey.andriyashin@nokia.com>2011-12-29 14:22:42 +0200
committerAlexey Andriyashin <alexey.andriyashin@nokia.com>2011-12-29 14:22:42 +0200
commit4f668f9ce17daeb62be99608707e5054591684ac (patch)
treedba146d1b779e4ab642722b70a63815c2508fff3 /tests/manual/testbed/PositionPicker.qml
parent50a745cd9c396c991ffa95c5f084484150a260f4 (diff)
downloadqtgraphicaleffects-4f668f9ce17daeb62be99608707e5054591684ac.tar.gz
Fix PositionPicker position after resize
Diffstat (limited to 'tests/manual/testbed/PositionPicker.qml')
-rw-r--r--tests/manual/testbed/PositionPicker.qml11
1 files changed, 4 insertions, 7 deletions
diff --git a/tests/manual/testbed/PositionPicker.qml b/tests/manual/testbed/PositionPicker.qml
index 522a690..d29c3ea 100644
--- a/tests/manual/testbed/PositionPicker.qml
+++ b/tests/manual/testbed/PositionPicker.qml
@@ -45,8 +45,8 @@ Image {
property real xValue: 0
property real yValue: 0
- x: xValue - positionPicker.width / 2
- y: yValue - positionPicker.height / 2
+ x: parent.width * xValue - positionPicker.width / 2
+ y: parent.height * yValue - positionPicker.height / 2
property alias pressed: mouseArea.pressed
@@ -65,11 +65,8 @@ Image {
}
onPositionChanged: {
- xValue = positionPicker.x + positionPicker.width / 2 + mouseX - startX;
- yValue = positionPicker.y + positionPicker.height / 2 + mouseY - startY;
-
- positionPicker.x += mouseX - startX;
- positionPicker.y += mouseY - startY;
+ xValue = (positionPicker.x + positionPicker.width / 2 + mouseX - startX) / positionPicker.parent.width;
+ yValue = (positionPicker.y + positionPicker.height / 2 + mouseY - startY) / positionPicker.parent.height;
}
}
}