mirror of
https://github.com/subsurface/subsurface.git
synced 2024-12-03 15:43:09 +00:00
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 <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
e40367fc39
commit
c84b40664d
2 changed files with 1 additions and 9 deletions
|
@ -14,6 +14,7 @@ DivePixmapItem::DivePixmapItem(QObject *parent) : QObject(parent), QGraphicsPixm
|
||||||
|
|
||||||
DivePictureItem::DivePictureItem(int row, QObject *parent): DivePixmapItem(parent)
|
DivePictureItem::DivePictureItem(int row, QObject *parent): DivePixmapItem(parent)
|
||||||
{
|
{
|
||||||
|
setFlag(ItemIgnoresTransformations);
|
||||||
#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
|
#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
|
||||||
setAcceptsHoverEvents(true);
|
setAcceptsHoverEvents(true);
|
||||||
#else
|
#else
|
||||||
|
@ -39,14 +40,6 @@ void DivePictureItem::setPixmap(const QPixmap &pix)
|
||||||
shadow->setBrush(QColor(Qt::lightGray));
|
shadow->setBrush(QColor(Qt::lightGray));
|
||||||
shadow->setFlag(ItemStacksBehindParent);
|
shadow->setFlag(ItemStacksBehindParent);
|
||||||
shadow->setZValue(-2);
|
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)
|
void DivePictureItem::hoverEnterEvent(QGraphicsSceneHoverEvent *event)
|
||||||
|
|
|
@ -1337,7 +1337,6 @@ void ProfileWidget2::plotPictures()
|
||||||
lastX = x;
|
lastX = x;
|
||||||
lastY = y;
|
lastY = y;
|
||||||
item->setPos(x, y);
|
item->setPos(x, y);
|
||||||
item->setFlag(QGraphicsItem::ItemIgnoresTransformations);
|
|
||||||
scene()->addItem(item);
|
scene()->addItem(item);
|
||||||
pictures.push_back(item);
|
pictures.push_back(item);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue