summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBernhard Beschow <bbeschow@cs.tu-berlin.de>2016-09-02 06:51:17 (GMT)
committerBernhard Beschow <bbeschow@cs.tu-berlin.de>2016-09-02 06:54:02 (GMT)
commit12d11ab73819d1f48e95416e02c003056200bf60 (patch)
tree248ff8c642fb1b593f1ab6a05c435f41ae4055da
parent88dc5fb3608961b6cd17876ea92f3915c36f2df3 (diff)
don't use physical widths if zoom level becomes < 0 (for whatever reason)
-rw-r--r--src/lib/marble/StyleBuilder.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/lib/marble/StyleBuilder.cpp b/src/lib/marble/StyleBuilder.cpp
index e89746e..bb03b21 100644
--- a/src/lib/marble/StyleBuilder.cpp
+++ b/src/lib/marble/StyleBuilder.cpp
@@ -1312,11 +1312,11 @@ GeoDataStyle::ConstPtr StyleBuilder::createStyle(const StyleParameters &paramete
visualCategory <= GeoDataFeature::HighwayMotorway) ||
visualCategory == GeoDataFeature::TransportAirportRunway) {
- if (parameters.tileLevel >= 0 && parameters.tileLevel <= 7) {
+ if (parameters.tileLevel <= 7) {
/** @todo: Dummy implementation for dynamic style changes based on tile level, replace with sane values */
lineStyle.setPhysicalWidth(0.0);
lineStyle.setWidth(3.0);
- } else if (parameters.tileLevel >= 0 && parameters.tileLevel <= 9) {
+ } else if (parameters.tileLevel <= 9) {
/** @todo: Dummy implementation for dynamic style changes based on tile level, replace with sane values */
lineStyle.setPhysicalWidth(0.0);
lineStyle.setWidth(4.0);
@@ -1360,8 +1360,11 @@ GeoDataStyle::ConstPtr StyleBuilder::createStyle(const StyleParameters &paramete
}
} else if (visualCategory == GeoDataFeature::NaturalWater) {
- if (parameters.tileLevel >= 0 && parameters.tileLevel <= 7) {
- lineStyle.setWidth(parameters.tileLevel <= 3 ? 1 : 2);
+ if (parameters.tileLevel <= 3) {
+ lineStyle.setWidth(1);
+ lineStyle.setPhysicalWidth(0.0);
+ } else if (parameters.tileLevel <= 7) {
+ lineStyle.setWidth(2);
lineStyle.setPhysicalWidth(0.0);
} else {
QString const widthValue = osmData.tagValue("width").remove(QStringLiteral(" meters")).remove(QStringLiteral(" m"));