QML UI: Fix incorrect sizing of dive profile

This resizes the dive profile to always maintain an equal width and
height, so that the sizing is the same in all devices.

Signed-off-by: Grace Karanja <gracie.karanja89@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Grace Karanja 2015-07-29 15:30:51 +03:00 committed by Dirk Hohndel
parent a27623dad0
commit d337def212

View file

@ -27,7 +27,7 @@ void QMLProfile::paint(QPainter *painter)
prefs.animation_speed = 0; // no animations while rendering the QGraphicsView
profile->plotDive(d);
QTransform profileTransform;
profileTransform.scale((this->width() / profile->sceneRect().width()) - 1, (this->height()/profile->sceneRect().height()) - 1);
profileTransform.scale(this->height() / 100, this->height() / 100);
profile->setTransform(profileTransform);
profile->render(painter);
prefs.animation_speed = old_animation_speed;