mirror of
https://github.com/tumic0/GPXSee.git
synced 2024-11-28 05:34:47 +01:00
Fixed rendering issues when digital zoom is active
This commit is contained in:
parent
0f48e7c137
commit
2748849032
@ -196,6 +196,8 @@ void PathItem::setDigitalZoom(int zoom)
|
||||
_digitalZoom = zoom;
|
||||
_pen.setWidthF(_width * pow(2, -_digitalZoom));
|
||||
_marker->setScale(pow(2, -_digitalZoom));
|
||||
for (int i = 0; i < _ticks.size(); i++)
|
||||
_ticks.at(i)->setDigitalZoom(zoom);
|
||||
|
||||
updateShape();
|
||||
}
|
||||
|
@ -16,6 +16,7 @@ public:
|
||||
|
||||
void setPos(const QPointF &pos);
|
||||
void setColor(const QColor &color) {_brush = QBrush(color);}
|
||||
void setDigitalZoom(int zoom) {setScale(pow(2, -zoom));}
|
||||
|
||||
int type() const {return parentItem()->type();}
|
||||
QString info() const {return static_cast<GraphicsItem*>(parentItem())->info();}
|
||||
|
@ -69,3 +69,11 @@ void RouteItem::showWaypointLabels(bool show)
|
||||
for (int i = 0; i < _waypoints.count(); i++)
|
||||
_waypoints[i]->showLabel(show);
|
||||
}
|
||||
|
||||
void RouteItem::setDigitalZoom(int zoom)
|
||||
{
|
||||
for (int i = 0; i < _waypoints.count(); i++)
|
||||
_waypoints[i]->setDigitalZoom(zoom);
|
||||
|
||||
PathItem::setDigitalZoom(zoom);
|
||||
}
|
||||
|
@ -16,6 +16,7 @@ public:
|
||||
RouteItem(const Route &route, Map *map, QGraphicsItem *parent = 0);
|
||||
|
||||
void setMap(Map *map);
|
||||
void setDigitalZoom(int zoom);
|
||||
|
||||
void showWaypoints(bool show);
|
||||
void showWaypointLabels(bool show);
|
||||
|
Loading…
Reference in New Issue
Block a user