From 135ff3dac17661309af568deef31f72e47f2e2c4 Mon Sep 17 00:00:00 2001 From: Chumva Date: Fri, 21 Sep 2018 12:59:02 +0300 Subject: [PATCH 1/2] Add dependency for poi,waypoints, and favourites text size from text size setting --- OsmAnd/src/net/osmand/plus/views/MapTextLayer.java | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/OsmAnd/src/net/osmand/plus/views/MapTextLayer.java b/OsmAnd/src/net/osmand/plus/views/MapTextLayer.java index f6e5a9789f..ae340431ff 100644 --- a/OsmAnd/src/net/osmand/plus/views/MapTextLayer.java +++ b/OsmAnd/src/net/osmand/plus/views/MapTextLayer.java @@ -62,6 +62,7 @@ public class MapTextLayer extends OsmandMapLayer { continue; } + updateTextSize(); paintTextIcon.setFakeBoldText(provider.isFakeBoldText()); for (Object o : textObjects.get(l)) { LatLon loc = provider.getTextLocation(o); @@ -158,7 +159,7 @@ public class MapTextLayer extends OsmandMapLayer { public void initLayer(OsmandMapTileView v) { this.view = v; paintTextIcon = new Paint(); - paintTextIcon.setTextSize(13 * v.getDensity()); + updateTextSize(); paintTextIcon.setTextAlign(Align.CENTER); paintTextIcon.setAntiAlias(true); Map> textObjectsLoc = new TreeMap<>(new Comparator() { @@ -188,4 +189,12 @@ public class MapTextLayer extends OsmandMapLayer { public boolean drawInScreenPixels() { return true; } + + private void updateTextSize() { + float scale = view.getApplication().getSettings().TEXT_SCALE.get(); + float textSize = scale * 13 * view.getDensity(); + if (paintTextIcon.getTextSize() != textSize) { + paintTextIcon.setTextSize(textSize); + } + } } From bb10fb8eae4e38fcaf0bec04a675865e7f36593a Mon Sep 17 00:00:00 2001 From: Chumva Date: Fri, 21 Sep 2018 13:17:30 +0300 Subject: [PATCH 2/2] Add const TEXT_SIZE --- OsmAnd/src/net/osmand/plus/views/MapTextLayer.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/OsmAnd/src/net/osmand/plus/views/MapTextLayer.java b/OsmAnd/src/net/osmand/plus/views/MapTextLayer.java index ae340431ff..c1dcf0ea50 100644 --- a/OsmAnd/src/net/osmand/plus/views/MapTextLayer.java +++ b/OsmAnd/src/net/osmand/plus/views/MapTextLayer.java @@ -22,6 +22,7 @@ public class MapTextLayer extends OsmandMapLayer { private static final int TEXT_WRAP = 15; private static final int TEXT_LINES = 3; + private static final int TEXT_SIZE = 13; private Map> textObjects = new LinkedHashMap<>(); private Paint paintTextIcon; @@ -192,7 +193,7 @@ public class MapTextLayer extends OsmandMapLayer { private void updateTextSize() { float scale = view.getApplication().getSettings().TEXT_SCALE.get(); - float textSize = scale * 13 * view.getDensity(); + float textSize = scale * TEXT_SIZE * view.getDensity(); if (paintTextIcon.getTextSize() != textSize) { paintTextIcon.setTextSize(textSize); }