summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAaron Kennedy <aaron.kennedy@nokia.com>2010-05-11 04:08:17 (GMT)
committerAaron Kennedy <aaron.kennedy@nokia.com>2010-05-11 04:10:05 (GMT)
commit367798c3cfaac56d82b29a90061d621e2b5854a5 (patch)
tree98381c0770242ab1b177a875042df7dcb0bed886 /src
parent5c4fc5b7517e5f226c3e4fe6f208b955c28aa6ca (diff)
downloadQt-367798c3cfaac56d82b29a90061d621e2b5854a5.zip
Qt-367798c3cfaac56d82b29a90061d621e2b5854a5.tar.gz
Qt-367798c3cfaac56d82b29a90061d621e2b5854a5.tar.bz2
Correct Flipable back item based on parent, not scene transform
Flipable transformation consists of two parts: 1. Detecting that the back face is visible 2. Transforming the back item as though "it were on the front" These are two steps. The first should be done in scene coordinates, and the second relative to the Flipable parent. QTBUG-10532
Diffstat (limited to 'src')
-rw-r--r--src/declarative/graphicsitems/qdeclarativeflipable.cpp15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/declarative/graphicsitems/qdeclarativeflipable.cpp b/src/declarative/graphicsitems/qdeclarativeflipable.cpp
index e2fc809..d926119 100644
--- a/src/declarative/graphicsitems/qdeclarativeflipable.cpp
+++ b/src/declarative/graphicsitems/qdeclarativeflipable.cpp
@@ -190,12 +190,15 @@ void QDeclarativeFlipablePrivate::updateSceneTransformFromParent()
QPointF p2(1, 0);
QPointF p3(1, 1);
- p1 = sceneTransform.map(p1);
- p2 = sceneTransform.map(p2);
- p3 = sceneTransform.map(p3);
-
- qreal cross = (p1.x() - p2.x()) * (p3.y() - p2.y()) -
- (p1.y() - p2.y()) * (p3.x() - p2.x());
+ QPointF scenep1 = sceneTransform.map(p1);
+ QPointF scenep2 = sceneTransform.map(p2);
+ QPointF scenep3 = sceneTransform.map(p3);
+ p1 = q->mapToParent(p1);
+ p2 = q->mapToParent(p2);
+ p3 = q->mapToParent(p3);
+
+ qreal cross = (scenep1.x() - scenep2.x()) * (scenep3.y() - scenep2.y()) -
+ (scenep1.y() - scenep2.y()) * (scenep3.x() - scenep2.x());
wantBackYFlipped = p1.x() >= p2.x();
wantBackXFlipped = p2.y() >= p3.y();