mirror of
https://github.com/tumic0/GPXSee.git
synced 2024-12-05 00:39:09 +01:00
Compare commits
3 Commits
2232e47821
...
4a0b7ec83e
Author | SHA1 | Date | |
---|---|---|---|
4a0b7ec83e | |||
c844eca91e | |||
6c91060cbb |
@ -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 type="unfinished"></translation>
|
||||
<translation>Adresář s CRS daty:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/GUI/gui.cpp" line="915"/>
|
||||
|
@ -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 type="unfinished"></translation>
|
||||
<translation>CRS-Verzeichnis:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/GUI/gui.cpp" line="915"/>
|
||||
|
@ -108,8 +108,6 @@ 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)
|
||||
@ -124,8 +122,6 @@ 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;
|
||||
|
||||
@ -177,7 +173,8 @@ void Style::area(QXmlStreamReader &reader, const QString &dir, qreal ratio,
|
||||
if (!file.isNull())
|
||||
ri._fillImage = image(file, width, height, ratio);
|
||||
|
||||
_paths.append(ri);
|
||||
if (ri.rule()._type == Rule::AnyType || ri.rule()._type == Rule::WayType)
|
||||
_paths.append(ri);
|
||||
|
||||
reader.skipCurrentElement();
|
||||
}
|
||||
@ -232,7 +229,8 @@ void Style::line(QXmlStreamReader &reader, const Rule &rule)
|
||||
ri._curve = true;
|
||||
}
|
||||
|
||||
_paths.append(ri);
|
||||
if (ri.rule()._type == Rule::AnyType || ri.rule()._type == Rule::WayType)
|
||||
_paths.append(ri);
|
||||
|
||||
reader.skipCurrentElement();
|
||||
}
|
||||
@ -275,7 +273,8 @@ void Style::circle(QXmlStreamReader &reader, const Rule &rule)
|
||||
? QPen(QBrush(strokeColor), strokeWidth) : Qt::NoPen;
|
||||
ri._brush = fillColor.isValid() ? QBrush(fillColor) : Qt::NoBrush;
|
||||
|
||||
_circles.append(ri);
|
||||
if (ri.rule()._type == Rule::AnyType || ri.rule()._type == Rule::NodeType)
|
||||
_circles.append(ri);
|
||||
|
||||
reader.skipCurrentElement();
|
||||
}
|
||||
@ -370,6 +369,10 @@ 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) {
|
||||
@ -392,8 +395,7 @@ void Style::symbol(QXmlStreamReader &reader, const QString &dir, qreal ratio,
|
||||
}
|
||||
}
|
||||
|
||||
if (!file.isNull())
|
||||
ri._img = image(file, width, height, ratio);
|
||||
ri._img = image(file, width, height, ratio);
|
||||
|
||||
_symbols.append(ri);
|
||||
|
||||
@ -639,7 +641,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);
|
||||
|
@ -74,10 +74,13 @@ 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++)
|
||||
if (!_keys.at(i) || _keys.at(i) == tags.at(j).key)
|
||||
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)
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user