summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCaio Marcelo de Oliveira Filho <caio.oliveira@openbossa.org>2009-10-16 15:43:25 (GMT)
committerEduardo M. Fleury <eduardo.fleury@openbossa.org>2009-10-26 22:17:48 (GMT)
commitd4c1a4675bdff63912b31243e5292766ff5215a5 (patch)
tree96f7e77af8b7b394e70cb5c96272541d975cb5a3
parentbee00ac4ca0865e621edaea54d079005c68f120e (diff)
downloadQt-d4c1a4675bdff63912b31243e5292766ff5215a5.zip
Qt-d4c1a4675bdff63912b31243e5292766ff5215a5.tar.gz
Qt-d4c1a4675bdff63912b31243e5292766ff5215a5.tar.bz2
QGAL: simplification doesn't depend on vertex anchor point information
Look for information inside the anchor instead of on the vertices. This will give us flexibility of simplifying vertices before the anchor simplification phase. Signed-off-by: Caio Marcelo de Oliveira Filho <caio.oliveira@openbossa.org> Reviewed-by: Eduardo M. Fleury <eduardo.fleury@openbossa.org>
-rw-r--r--src/gui/graphicsview/qgraphicsanchorlayout_p.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/gui/graphicsview/qgraphicsanchorlayout_p.cpp b/src/gui/graphicsview/qgraphicsanchorlayout_p.cpp
index aa510f1..b0b1408 100644
--- a/src/gui/graphicsview/qgraphicsanchorlayout_p.cpp
+++ b/src/gui/graphicsview/qgraphicsanchorlayout_p.cpp
@@ -701,8 +701,6 @@ bool QGraphicsAnchorLayoutPrivate::simplifyGraphIteration(QGraphicsAnchorLayoutP
QVector<AnchorVertex*> candidates;
bool candidatesForward;
- const Qt::AnchorPoint centerEdge = pickEdge(Qt::AnchorHorizontalCenter, orientation);
-
// Walk depth-first, in the stack we store start of the candidate sequence (beforeSequence)
// and the vertex to be visited.
while (!stack.isEmpty()) {
@@ -811,7 +809,8 @@ bool QGraphicsAnchorLayoutPrivate::simplifyGraphIteration(QGraphicsAnchorLayoutP
// One restriction we have is to not simplify half of an anchor and let the other half
// unsimplified. So we remove center edges before and after the sequence.
- if (beforeSequence->m_edge == centerEdge && beforeSequence->m_item == candidates.first()->m_item) {
+ const AnchorData *firstAnchor = g.edgeData(beforeSequence, candidates.first());
+ if (firstAnchor->isCenterAnchor) {
beforeSequence = candidates.first();
candidates.remove(0);
@@ -820,7 +819,8 @@ bool QGraphicsAnchorLayoutPrivate::simplifyGraphIteration(QGraphicsAnchorLayoutP
continue;
}
- if (afterSequence->m_edge == centerEdge && afterSequence->m_item == candidates.last()->m_item) {
+ const AnchorData *lastAnchor = g.edgeData(candidates.last(), afterSequence);
+ if (lastAnchor->isCenterAnchor) {
afterSequence = candidates.last();
candidates.remove(candidates.count() - 1);