From 367798c3cfaac56d82b29a90061d621e2b5854a5 Mon Sep 17 00:00:00 2001 From: Aaron Kennedy Date: Tue, 11 May 2010 14:08:17 +1000 Subject: 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 --- src/declarative/graphicsitems/qdeclarativeflipable.cpp | 15 +++++++++------ 1 file 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(); -- cgit v0.12