mirror of
https://github.com/tumic0/GPXSee.git
synced 2025-02-17 16:20:48 +01:00
Added missing area-under-mouse highlighting
This commit is contained in:
parent
1497d42bd5
commit
3ad0c89511
@ -153,3 +153,21 @@ void AreaItem::setDigitalZoom(int zoom)
|
|||||||
_digitalZoom = zoom;
|
_digitalZoom = zoom;
|
||||||
_pen.setWidthF(_width * pow(2, -_digitalZoom));
|
_pen.setWidthF(_width * pow(2, -_digitalZoom));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void AreaItem::hoverEnterEvent(QGraphicsSceneHoverEvent *event)
|
||||||
|
{
|
||||||
|
Q_UNUSED(event);
|
||||||
|
|
||||||
|
_pen.setWidthF((_width + 1) * pow(2, -_digitalZoom));
|
||||||
|
setZValue(zValue() + 1.0);
|
||||||
|
update();
|
||||||
|
}
|
||||||
|
|
||||||
|
void AreaItem::hoverLeaveEvent(QGraphicsSceneHoverEvent *event)
|
||||||
|
{
|
||||||
|
Q_UNUSED(event);
|
||||||
|
|
||||||
|
_pen.setWidthF(_width * pow(2, -_digitalZoom));
|
||||||
|
setZValue(zValue() - 1.0);
|
||||||
|
update();
|
||||||
|
}
|
||||||
|
@ -27,6 +27,9 @@ public:
|
|||||||
void setDigitalZoom(int zoom);
|
void setDigitalZoom(int zoom);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
void hoverEnterEvent(QGraphicsSceneHoverEvent *event);
|
||||||
|
void hoverLeaveEvent(QGraphicsSceneHoverEvent *event);
|
||||||
|
|
||||||
QPainterPath painterPath(const Polygon &polygon);
|
QPainterPath painterPath(const Polygon &polygon);
|
||||||
void updatePainterPath();
|
void updatePainterPath();
|
||||||
QString toolTip() const;
|
QString toolTip() const;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user