mirror of
https://github.com/tumic0/GPXSee.git
synced 2024-12-05 00:39:09 +01:00
Compare commits
No commits in common. "320b04c3fadf617d5ef9f445d8522b55b915f57d" and "822a0c28663655c4648a3791f0ee9b1063da8129" have entirely different histories.
320b04c3fa
...
822a0c2866
@ -1,4 +1,4 @@
|
||||
version: 13.4.{build}
|
||||
version: 13.3.{build}
|
||||
|
||||
configuration:
|
||||
- Release
|
||||
|
@ -3,7 +3,7 @@ unix:!macx:!android {
|
||||
} else {
|
||||
TARGET = GPXSee
|
||||
}
|
||||
VERSION = 13.4
|
||||
VERSION = 13.3
|
||||
|
||||
QT += core \
|
||||
gui \
|
||||
|
@ -37,7 +37,7 @@ Unicode true
|
||||
; The name of the installer
|
||||
Name "GPXSee"
|
||||
; Program version
|
||||
!define VERSION "13.4"
|
||||
!define VERSION "13.3"
|
||||
|
||||
; The file to write
|
||||
OutFile "GPXSee-${VERSION}_x64.exe"
|
||||
|
@ -1,4 +1,3 @@
|
||||
#include <cmath>
|
||||
#include <QPainter>
|
||||
#include <QCache>
|
||||
#include "common/programpaths.h"
|
||||
@ -9,8 +8,6 @@ using namespace Mapsforge;
|
||||
|
||||
#define TEXT_EXTENT 160
|
||||
|
||||
static double limit = cos(deg2rad(170));
|
||||
|
||||
static qreal area(const QPainterPath &polygon)
|
||||
{
|
||||
qreal area = 0;
|
||||
@ -58,47 +55,6 @@ static const QColor *haloColor(const Style::TextRender *ti)
|
||||
? &ti->strokeColor() : 0;
|
||||
}
|
||||
|
||||
static QPainterPath parallelPath(const QPainterPath &p, double dy)
|
||||
{
|
||||
int n = p.elementCount() - 1;
|
||||
QVector<QPointF> u(n);
|
||||
QPainterPath h;
|
||||
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(5, 13, 0)
|
||||
h.reserve(p.elementCount());
|
||||
#endif // QT 5.13
|
||||
|
||||
for (int k = 0; k < n; k++) {
|
||||
qreal c = p.elementAt(k + 1).x - p.elementAt(k).x;
|
||||
qreal s = p.elementAt(k + 1).y - p.elementAt(k).y;
|
||||
qreal l = sqrt(c * c + s * s);
|
||||
|
||||
u[k] = (l == 0) ? QPointF(0, 0) : QPointF(c / l, s / l);
|
||||
|
||||
if (k == 0)
|
||||
continue;
|
||||
if (u.at(k).x() * u.at(k-1).x() + u.at(k).y() * u.at(k-1).y() < limit)
|
||||
return p;
|
||||
}
|
||||
|
||||
h.moveTo(QPointF(p.elementAt(0).x - dy * u.at(0).y(),
|
||||
p.elementAt(0).y + dy * u.at(0).x()));
|
||||
|
||||
for (int k = 1; k < n; k++) {
|
||||
qreal l = dy / (1 + u.at(k).x() * u.at(k-1).x()
|
||||
+ u.at(k).y() * u.at(k-1).y());
|
||||
QPainterPath::Element e(p.elementAt(k));
|
||||
|
||||
h.lineTo(QPointF(e.x - l * (u.at(k).y() + u.at(k-1).y()),
|
||||
e.y + l * (u.at(k).x() + u.at(k-1).x())));
|
||||
}
|
||||
|
||||
h.lineTo(QPointF(p.elementAt(n).x - dy * u.at(n-1).y(),
|
||||
p.elementAt(n).y + dy * u.at(n-1).x()));
|
||||
|
||||
return h;
|
||||
}
|
||||
|
||||
void RasterTile::processPointLabels(const QList<MapData::Point> &points,
|
||||
QList<TextItem*> &textItems)
|
||||
{
|
||||
@ -350,17 +306,13 @@ void RasterTile::drawPaths(QPainter *painter, const QList<MapData::Path> &paths,
|
||||
|
||||
if (path) {
|
||||
const Style::PathRender *ri = is.pathRender();
|
||||
qreal dy = ri->dy(_zoom);
|
||||
|
||||
if (!path->pp.elementCount())
|
||||
path->pp = painterPath(path->path->poly, ri->curve());
|
||||
|
||||
painter->setPen(ri->pen(_zoom));
|
||||
painter->setBrush(ri->brush());
|
||||
if (dy != 0)
|
||||
painter->drawPath(parallelPath(path->pp, dy));
|
||||
else
|
||||
painter->drawPath(path->pp);
|
||||
painter->drawPath(path->pp);
|
||||
} else {
|
||||
const Style::CircleRender *ri = is.circleRender();
|
||||
qreal radius = ri->radius(_zoom);
|
||||
|
@ -245,13 +245,6 @@ void Style::line(QXmlStreamReader &reader, const Rule &rule)
|
||||
if (curve == "cubic")
|
||||
ri._curve = true;
|
||||
}
|
||||
if (attr.hasAttribute("dy")) {
|
||||
ri._dy = attr.value("dy").toDouble(&ok);
|
||||
if (!ok) {
|
||||
reader.raiseError("invalid dy value");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (ri.rule()._type == Rule::AnyType || ri.rule()._type == Rule::WayType)
|
||||
_paths.append(ri);
|
||||
@ -696,11 +689,6 @@ QPen Style::PathRender::pen(int zoom) const
|
||||
return Qt::NoPen;
|
||||
}
|
||||
|
||||
qreal Style::PathRender::dy(int zoom) const
|
||||
{
|
||||
return (_scale && zoom >= 12) ? pow(1.5, zoom - 12) * _dy : _dy;
|
||||
}
|
||||
|
||||
qreal Style::CircleRender::radius(int zoom) const
|
||||
{
|
||||
return (_scale && zoom >= 12) ? pow(1.5, zoom - 12) * _radius : _radius;
|
||||
|
@ -137,14 +137,13 @@ public:
|
||||
PathRender(const Rule &rule, int zOrder) : Render(rule),
|
||||
_zOrder(zOrder), _strokeWidth(0), _strokeCap(Qt::RoundCap),
|
||||
_strokeJoin(Qt::RoundJoin), _area(false), _curve(false),
|
||||
_scale(Stroke), _dy(0) {}
|
||||
_scale(Stroke) {}
|
||||
|
||||
int zOrder() const {return _zOrder;}
|
||||
QPen pen(int zoom) const;
|
||||
const QBrush &brush() const {return _brush;}
|
||||
bool area() const {return _area;}
|
||||
bool curve() const {return _curve;}
|
||||
qreal dy(int zoom) const;
|
||||
|
||||
private:
|
||||
friend class Style;
|
||||
@ -160,7 +159,6 @@ public:
|
||||
QBrush _brush;
|
||||
bool _area, _curve;
|
||||
Scale _scale;
|
||||
qreal _dy;
|
||||
};
|
||||
|
||||
class CircleRender : public Render
|
||||
|
Loading…
Reference in New Issue
Block a user