summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSamuel Rødal <sroedal@trolltech.com>2008-11-26 18:23:19 +0100
committerSamuel Rødal <sroedal@trolltech.com>2008-11-26 18:23:19 +0100
commit5d14d37dd49a209e184c023997591d50f1458711 (patch)
tree29ee1e8ba7f16ff3cbe4ab6c932224e20399d73c
parent45d8a8263ed2e09b8379da4cf5a1a56ae6683432 (diff)
Better scaling of items.
-rw-r--r--mazescene.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/mazescene.cpp b/mazescene.cpp
index ec667f6..addf130 100644
--- a/mazescene.cpp
+++ b/mazescene.cpp
@@ -99,9 +99,10 @@ WallItem::WallItem(MazeScene *scene, const QPointF &a, const QPointF &b)
QRectF rect = m_childItem->boundingRect();
QPointF center = rect.center();
- const qreal scale = index ? 0.7 : 0.1;
+ qreal scale = index ? 0.8 : 0.2;
- m_childItem->scale(scale / rect.width(), scale / rect.height());
+ scale = qMin(scale / rect.width(), scale / rect.height());
+ m_childItem->scale(scale, scale);
m_childItem->translate(-center.x(), -center.y());
++index;