mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
New profile: fix Information overlay location
By simply storing the coordinates based on the scene (instead of trying to map them to real coordinates) the overlay position is correctly restored. Also remove the redundant positioning before readPos is called. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
13e2210d75
commit
ae2f18678d
2 changed files with 3 additions and 6 deletions
|
|
@ -184,10 +184,9 @@ void ToolTipItem::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
|
|||
|
||||
void ToolTipItem::persistPos()
|
||||
{
|
||||
QPoint currentPos = scene()->views().at(0)->mapFromScene(pos());
|
||||
QSettings s;
|
||||
s.beginGroup("ProfileMap");
|
||||
s.setValue("tooltip_position", currentPos);
|
||||
s.setValue("tooltip_position", pos());
|
||||
s.endGroup();
|
||||
}
|
||||
|
||||
|
|
@ -195,8 +194,7 @@ void ToolTipItem::readPos()
|
|||
{
|
||||
QSettings s;
|
||||
s.beginGroup("ProfileMap");
|
||||
QPointF value = scene()->views().at(0)->mapToScene(
|
||||
s.value("tooltip_position").toPoint());
|
||||
QPointF value = s.value("tooltip_position").toPoint();
|
||||
if (!scene()->sceneRect().contains(value)) {
|
||||
value = QPointF(0, 0);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue