From c84b40664de756b103e3304fb015edc05049ae39 Mon Sep 17 00:00:00 2001 From: Tomaz Canabrava Date: Fri, 27 Jun 2014 18:13:33 -0300 Subject: [PATCH] Fix dive picture position I was messing with the origin point, making the dive picture be a tiny bit to the right. This removes the rotation, but that was also not very good. Signed-off-by: Tomaz Canabrava Signed-off-by: Dirk Hohndel --- qt-ui/profile/divepixmapitem.cpp | 9 +-------- qt-ui/profile/profilewidget2.cpp | 1 - 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/qt-ui/profile/divepixmapitem.cpp b/qt-ui/profile/divepixmapitem.cpp index 060f47afb..d2f3a692a 100644 --- a/qt-ui/profile/divepixmapitem.cpp +++ b/qt-ui/profile/divepixmapitem.cpp @@ -14,6 +14,7 @@ DivePixmapItem::DivePixmapItem(QObject *parent) : QObject(parent), QGraphicsPixm DivePictureItem::DivePictureItem(int row, QObject *parent): DivePixmapItem(parent) { + setFlag(ItemIgnoresTransformations); #if QT_VERSION < QT_VERSION_CHECK(5, 0, 0) setAcceptsHoverEvents(true); #else @@ -39,14 +40,6 @@ void DivePictureItem::setPixmap(const QPixmap &pix) shadow->setBrush(QColor(Qt::lightGray)); shadow->setFlag(ItemStacksBehindParent); shadow->setZValue(-2); - - setTransformOriginPoint(boundingRect().width()/2, boundingRect().height()/2); - - qreal angle = qrand() % 5; - if (rand() % 2) - angle *= -1; - - setRotation(angle); } void DivePictureItem::hoverEnterEvent(QGraphicsSceneHoverEvent *event) diff --git a/qt-ui/profile/profilewidget2.cpp b/qt-ui/profile/profilewidget2.cpp index d8764c461..299cc2972 100644 --- a/qt-ui/profile/profilewidget2.cpp +++ b/qt-ui/profile/profilewidget2.cpp @@ -1337,7 +1337,6 @@ void ProfileWidget2::plotPictures() lastX = x; lastY = y; item->setPos(x, y); - item->setFlag(QGraphicsItem::ItemIgnoresTransformations); scene()->addItem(item); pictures.push_back(item); }