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

Compare commits

...

6 Commits

Author SHA1 Message Date
Hosted Weblate
4615709b99
Merge branch 'origin/master' into Weblate. 2023-05-19 01:31:46 +02:00
8a72b20af8 Added support for all paths scaling modes 2023-05-19 01:30:54 +02:00
Hosted Weblate
f86aa8c012
Merge branch 'origin/master' into Weblate. 2023-05-17 23:15:09 +02:00
Hosted Weblate
dbf5828e65
Merge branch 'origin/master' into Weblate. 2023-05-16 23:03:34 +02:00
ERYpTION
37d408c953
Translated using Weblate (Danish)
Currently translated at 100.0% (467 of 467 strings)

Translation: GPXSee/Translations
Translate-URL: https://hosted.weblate.org/projects/gpxsee/translations/da/
2023-05-16 21:51:52 +02:00
Arthur Perrin
61c3ed60d7
Translated using Weblate (French)
Currently translated at 99.7% (466 of 467 strings)

Translation: GPXSee/Translations
Translate-URL: https://hosted.weblate.org/projects/gpxsee/translations/fr/
2023-05-14 00:53:09 +02:00
4 changed files with 30 additions and 8 deletions

View File

@ -712,7 +712,7 @@
<location filename="../src/GUI/gui.cpp" line="907"/>
<location filename="../src/GUI/gui.cpp" line="925"/>
<source>CRS directory:</source>
<translation type="unfinished"></translation>
<translation>CRS-katalog:</translation>
</message>
<message>
<location filename="../src/GUI/gui.cpp" line="913"/>

View File

@ -958,7 +958,7 @@
<location filename="../src/GUI/gui.cpp" line="907"/>
<location filename="../src/GUI/gui.cpp" line="925"/>
<source>CRS directory:</source>
<translation type="unfinished"></translation>
<translation>Dossier CRS:</translation>
</message>
<message>
<location filename="../src/GUI/gui.cpp" line="915"/>
@ -1427,12 +1427,12 @@
<message>
<location filename="../src/GUI/optionsdialog.cpp" line="70"/>
<source>Select the proper coordinate reference system (CRS) of maps without a CRS definition (JNX, KMZ and World file maps).</source>
<translation type="unfinished"></translation>
<translation type="unfinished">Sélectionnez le système de référence de coordonnée (CRS) approprié pour les cartes sans définition de CRS (JNX, KMZ et World file maps).</translation>
</message>
<message>
<location filename="../src/GUI/optionsdialog.cpp" line="73"/>
<source>Select the desired projection of vector maps (IMG, Mapsforge and ENC maps). The projection must be valid for the whole map area.</source>
<translation type="unfinished"></translation>
<translation>Sélectionnez la projection désirée de la carte vectorielle (IMG, Mapsforge et carte ENC). La projection doit être valide pour la totalité de la zone de la carte.</translation>
</message>
<message>
<location filename="../src/GUI/optionsdialog.cpp" line="77"/>
@ -1912,7 +1912,7 @@
<message>
<location filename="../src/GUI/optionsdialog.cpp" line="758"/>
<source>DEM cache size:</source>
<translation type="unfinished"></translation>
<translation>Taille du cache DEM :</translation>
</message>
<message>
<location filename="../src/GUI/optionsdialog.cpp" line="778"/>

View File

@ -154,6 +154,13 @@ void Style::area(QXmlStreamReader &reader, const QString &dir, qreal ratio,
return;
}
}
if (attr.hasAttribute("scale")) {
QString scale(attr.value("scale").toString());
if (scale == "all")
ri._scale = PathRender::Scale::All;
else if (scale == "none")
ri._scale = PathRender::Scale::None;
}
if (attr.hasAttribute("src"))
file = resourcePath(attr.value("src").toString(), dir);
if (attr.hasAttribute("symbol-height")) {
@ -226,6 +233,13 @@ void Style::line(QXmlStreamReader &reader, const Rule &rule)
else if (join == "bevel")
ri._strokeJoin = Qt::BevelJoin;
}
if (attr.hasAttribute("scale")) {
QString scale(attr.value("scale").toString());
if (scale == "all")
ri._scale = PathRender::Scale::All;
else if (scale == "none")
ri._scale = PathRender::Scale::None;
}
if (attr.hasAttribute("curve")) {
QString curve(attr.value("curve").toString());
if (curve == "cubic")
@ -656,14 +670,18 @@ QList<const Style::Symbol*> Style::areaSymbols(int zoom) const
QPen Style::PathRender::pen(int zoom) const
{
if (_strokeColor.isValid()) {
qreal width = (zoom >= 12)
qreal width = (_scale > None && zoom >= 12)
? pow(1.5, zoom - 12) * _strokeWidth : _strokeWidth;
QPen p(QBrush(_strokeColor), width, Qt::SolidLine, _strokeCap,
_strokeJoin);
if (!_strokeDasharray.isEmpty()) {
QVector<qreal>pattern(_strokeDasharray);
for (int i = 0; i < _strokeDasharray.size(); i++)
for (int i = 0; i < _strokeDasharray.size(); i++) {
if (_scale > Stroke && zoom >= 12)
pattern[i] = (pow(1.5, zoom - 12) * pattern[i]);
// QPainter pattern is specified in units of the pens width!
pattern[i] /= width;
}
p.setDashPattern(pattern);
}
return p;

View File

@ -136,7 +136,8 @@ public:
public:
PathRender(const Rule &rule, int zOrder) : Render(rule),
_zOrder(zOrder), _strokeWidth(0), _strokeCap(Qt::RoundCap),
_strokeJoin(Qt::RoundJoin), _area(false), _curve(false) {}
_strokeJoin(Qt::RoundJoin), _area(false), _curve(false),
_scale(Stroke) {}
int zOrder() const {return _zOrder;}
QPen pen(int zoom) const;
@ -147,6 +148,8 @@ public:
private:
friend class Style;
enum Scale {None, Stroke, All};
int _zOrder;
QColor _strokeColor;
qreal _strokeWidth;
@ -155,6 +158,7 @@ public:
Qt::PenJoinStyle _strokeJoin;
QBrush _brush;
bool _area, _curve;
Scale _scale;
};
class CircleRender : public Render