1
0
mirror of https://github.com/tumic0/GPXSee.git synced 2024-12-04 16:29:09 +01:00

Compare commits

..

No commits in common. "04ef7ba0928025c16f031c4ed15acdefd5ced8c0" and "f5d4974d57bf7f11cddcdf2f253655241179437b" have entirely different histories.

7 changed files with 13 additions and 61 deletions

View File

@ -118,7 +118,6 @@ MapView::MapView(Map *map, POI *poi, QWidget *parent) : QGraphicsView(parent)
_showPosition = false;
_showPositionCoordinates = false;
_showMotionInfo = false;
_infoBackground = false;
_opengl = false;
_plot = false;
@ -157,8 +156,6 @@ PathItem *MapView::addTrack(const Track &track)
ti->setVisible(_showTracks);
ti->setDigitalZoom(_digitalZoom);
ti->setMarkerColor(_markerColor);
ti->setMarkerBackgroundColor(_backgroundColor);
ti->drawMarkerBackground(_infoBackground);
ti->showMarker(_showMarkers);
ti->showMarkerInfo(_markerInfoType);
ti->showTicks(_showPathTicks);
@ -189,8 +186,6 @@ PathItem *MapView::addRoute(const Route &route)
ri->showWaypointIcons(_showWaypointIcons);
ri->setDigitalZoom(_digitalZoom);
ri->setMarkerColor(_markerColor);
ri->setMarkerBackgroundColor(_backgroundColor);
ri->drawMarkerBackground(_infoBackground);
ri->showMarker(_showMarkers);
ri->showMarkerInfo(_markerInfoType);
ri->showTicks(_showPathTicks);
@ -1091,11 +1086,6 @@ void MapView::setBackgroundColor(const QColor &color)
_positionCoordinates->setBackgroundColor(color);
_motionInfo->setBackgroundColor(color);
for (int i = 0; i < _tracks.size(); i++)
_tracks.at(i)->setMarkerBackgroundColor(color);
for (int i = 0; i < _routes.size(); i++)
_routes.at(i)->setMarkerBackgroundColor(color);
reloadMap();
}
@ -1388,16 +1378,9 @@ void MapView::setInfoColor(const QColor &color)
void MapView::drawInfoBackground(bool draw)
{
_infoBackground = draw;
_cursorCoordinates->drawBackground(draw);
_positionCoordinates->drawBackground(draw);
_motionInfo->drawBackground(draw);
for (int i = 0; i < _tracks.size(); i++)
_tracks.at(i)->drawMarkerBackground(draw);
for (int i = 0; i < _routes.size(); i++)
_routes.at(i)->drawMarkerBackground(draw);
}
void MapView::setHidpi(bool hidpi)

View File

@ -203,7 +203,6 @@ private:
int _waypointSize, _poiSize;
QColor _backgroundColor, _waypointColor, _poiColor, _markerColor;
qreal _areaOpacity;
bool _infoBackground;
int _digitalZoom;
bool _plot;

View File

@ -13,8 +13,6 @@ CoordinatesFormat MarkerInfoItem::_format = DecimalDegrees;
MarkerInfoItem::MarkerInfoItem(QGraphicsItem *parent) : QGraphicsItem(parent)
{
_color = Qt::red;
_bgColor = Qt::white;
_drawBackground = false;
_font.setPixelSize(FONT_SIZE);
_font.setFamily(FONT_FAMILY);
@ -64,15 +62,13 @@ void MarkerInfoItem::paint(QPainter *painter, const QStyleOptionGraphicsItem
QRectF r2(OFFSET, 0, fm.boundingRect(_s2).width(), fm.height()
- fm.descent());
if (_drawBackground) {
painter->setPen(Qt::NoPen);
QColor bc(_bgColor);
bc.setAlpha(196);
painter->setBrush(QBrush(bc));
painter->drawRect(r2);
painter->drawRect(r1);
painter->setBrush(Qt::NoBrush);
}
painter->setPen(Qt::NoPen);
QColor bc(painter->background().color());
bc.setAlpha(196);
painter->setBrush(QBrush(bc));
painter->drawRect(r2);
painter->drawRect(r1);
painter->setBrush(Qt::NoBrush);
painter->setFont(_font);
painter->setPen(_color);
@ -88,15 +84,3 @@ void MarkerInfoItem::setColor(const QColor &color)
_color = color;
update();
}
void MarkerInfoItem::setBackgroundColor(const QColor &color)
{
_bgColor = color;
update();
}
void MarkerInfoItem::drawBackground(bool draw)
{
_drawBackground = draw;
update();
}

View File

@ -26,8 +26,6 @@ public:
void setCoordinates(const Coordinates &c);
void setColor(const QColor &color);
void setBackgroundColor(const QColor &color);
void drawBackground(bool draw);
static void setCoordinatesFormat(const CoordinatesFormat &format)
{_format = format;}
@ -37,9 +35,8 @@ private:
QString _s1, _s2;
QRectF _boundingRect;
QColor _color, _bgColor;
QColor _color;
QFont _font;
bool _drawBackground;
static CoordinatesFormat _format;
};

View File

@ -365,16 +365,6 @@ void PathItem::setMarkerColor(const QColor &color)
_markerInfo->setColor(color);
}
void PathItem::setMarkerBackgroundColor(const QColor &color)
{
_markerInfo->setBackgroundColor(color);
}
void PathItem::drawMarkerBackground(bool draw)
{
_markerInfo->drawBackground(draw);
}
void PathItem::hover(bool hover)
{
if (hover) {

View File

@ -41,8 +41,6 @@ public:
void setPenStyle(Qt::PenStyle style);
void setDigitalZoom(int zoom);
void setMarkerColor(const QColor &color);
void setMarkerBackgroundColor(const QColor &color);
void drawMarkerBackground(bool draw);
void showMarker(bool show);
void showMarkerInfo(MarkerInfoItem::Type type);
void showTicks(bool show);

View File

@ -10,7 +10,7 @@ using namespace Mapsforge;
#define PATHS_EXTENT 20
#define SEARCH_EXTENT -0.5
static double LIMIT = cos(deg2rad(170));
static double limit = cos(deg2rad(170));
static qreal area(const QPainterPath &polygon)
{
@ -78,7 +78,7 @@ static QPainterPath parallelPath(const QPainterPath &p, double dy)
if (k == 0)
continue;
if (u.at(k).x() * u.at(k-1).x() + u.at(k).y() * u.at(k-1).y() < LIMIT)
if (u.at(k).x() * u.at(k-1).x() + u.at(k).y() * u.at(k-1).y() < limit)
return p;
}
@ -127,8 +127,9 @@ void RasterTile::processPointLabels(const QList<MapData::Point> &points,
if ((lbl = label(ri->key(), point.tags))) {
if (si && si->id() != ri->symbolId())
continue;
if (!ti || ti->priority() < ri->priority())
ti = ri;
ti = ri;
break;
}
}
}