From 82566a4137e23ab73f7853d897e5702b686054cf Mon Sep 17 00:00:00 2001 From: Alan Alpert Date: Mon, 9 Nov 2009 18:28:04 +1000 Subject: Fix perspective in dynamic example working Z and items can no longer be placed in the sky (due to scaling). --- examples/declarative/dynamic/qml/PerspectiveItem.qml | 11 +++++++---- examples/declarative/dynamic/qml/itemCreation.js | 2 +- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/examples/declarative/dynamic/qml/PerspectiveItem.qml b/examples/declarative/dynamic/qml/PerspectiveItem.qml index 55a70d5..728c3a5 100644 --- a/examples/declarative/dynamic/qml/PerspectiveItem.qml +++ b/examples/declarative/dynamic/qml/PerspectiveItem.qml @@ -3,10 +3,13 @@ import Qt 4.6 Image { id: tree property bool created: false - opacity: y+height > window.height/2 ? 1 : 0.25 - onCreatedChanged: if (created && y+height<=window.height/2) { tree.destroy() } - scale: y+height > window.height/2 ? (y+height-250)*0.01 : 1 + property double scaleFactor: Math.max((y+height-250)*0.01, 0.3) + property double scaledBottom: y + (height+height*scaleFactor)/2 + property bool onLand: scaledBottom > window.height/2 + opacity: onLand ? 1 : 0.25 + onCreatedChanged: if (created && !onLand) { tree.destroy() } else { z = scaledBottom } + scale: scaleFactor transformOrigin: "Center" source: image; smooth: true - z: y + onYChanged: z = scaledBottom } diff --git a/examples/declarative/dynamic/qml/itemCreation.js b/examples/declarative/dynamic/qml/itemCreation.js index b3e8ba5..ccc03aa 100644 --- a/examples/declarative/dynamic/qml/itemCreation.js +++ b/examples/declarative/dynamic/qml/itemCreation.js @@ -32,7 +32,7 @@ function loadComponent() { createItem(); itemComponent = createComponent(itemButton.file); - print(itemButton.file) + //print(itemButton.file) if(itemComponent.isLoading){ component.statusChanged.connect(finishCreation); }else{//Depending on the content, it can be ready or error immediately -- cgit v0.12