1
0
mirror of https://github.com/tumic0/GPXSee.git synced 2025-04-21 12:49:10 +02:00

Compare commits

..

No commits in common. "4a0b7ec83eddb169adbf9bd2f54907210f1a50c7" and "2232e47821435db25844faf631c40f7b47fafcb8" have entirely different histories.

4 changed files with 15 additions and 20 deletions

View File

@ -882,7 +882,7 @@
<location filename="../src/GUI/gui.cpp" line="907"/>
<location filename="../src/GUI/gui.cpp" line="925"/>
<source>CRS directory:</source>
<translation>Adresář s CRS daty:</translation>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/GUI/gui.cpp" line="915"/>

View File

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

View File

@ -108,6 +108,8 @@ bool Style::Rule::match(int zoom, bool closed,
{
Closed cl = closed ? YesClosed : NoClosed;
if (_type && WayType != _type)
return false;
if (!_zooms.contains(zoom))
return false;
if (_closed && cl != _closed)
@ -122,6 +124,8 @@ bool Style::Rule::match(int zoom, bool closed,
bool Style::Rule::match(int zoom, const QVector<MapData::Tag> &tags) const
{
if (_type && NodeType != _type)
return false;
if (!_zooms.contains(zoom))
return false;
@ -173,7 +177,6 @@ void Style::area(QXmlStreamReader &reader, const QString &dir, qreal ratio,
if (!file.isNull())
ri._fillImage = image(file, width, height, ratio);
if (ri.rule()._type == Rule::AnyType || ri.rule()._type == Rule::WayType)
_paths.append(ri);
reader.skipCurrentElement();
@ -229,7 +232,6 @@ void Style::line(QXmlStreamReader &reader, const Rule &rule)
ri._curve = true;
}
if (ri.rule()._type == Rule::AnyType || ri.rule()._type == Rule::WayType)
_paths.append(ri);
reader.skipCurrentElement();
@ -273,7 +275,6 @@ void Style::circle(QXmlStreamReader &reader, const Rule &rule)
? QPen(QBrush(strokeColor), strokeWidth) : Qt::NoPen;
ri._brush = fillColor.isValid() ? QBrush(fillColor) : Qt::NoBrush;
if (ri.rule()._type == Rule::AnyType || ri.rule()._type == Rule::NodeType)
_circles.append(ri);
reader.skipCurrentElement();
@ -369,10 +370,6 @@ void Style::symbol(QXmlStreamReader &reader, const QString &dir, qreal ratio,
if (attr.hasAttribute("src"))
file = resourcePath(attr.value("src").toString(), dir);
else {
reader.raiseError("missing src value");
return;
}
if (attr.hasAttribute("symbol-height")) {
height = attr.value("symbol-height").toInt(&ok);
if (!ok || height < 0) {
@ -395,6 +392,7 @@ void Style::symbol(QXmlStreamReader &reader, const QString &dir, qreal ratio,
}
}
if (!file.isNull())
ri._img = image(file, width, height, ratio);
_symbols.append(ri);
@ -641,7 +639,7 @@ QList<const Style::Symbol*> Style::areaSymbols(int zoom) const
for (int i = 0; i < _symbols.size(); i++) {
const Symbol &symbol = _symbols.at(i);
const Rule &rule = symbol.rule();
const Rule & rule = symbol.rule();
if (rule._zooms.contains(zoom) && (rule._type == Rule::AnyType
|| rule._type == Rule::WayType))
list.append(&symbol);

View File

@ -74,13 +74,10 @@ public:
private:
bool keyMatches(const QVector<MapData::Tag> &tags) const
{
for (int i = 0; i < _keys.size(); i++) {
for (int j = 0; j < tags.size(); j++) {
unsigned key = _keys.at(i);
if (!key || key == tags.at(j).key)
for (int i = 0; i < _keys.size(); i++)
for (int j = 0; j < tags.size(); j++)
if (!_keys.at(i) || _keys.at(i) == tags.at(j).key)
return true;
}
}
return false;
}