Add dependency for poi,waypoints, and favourites text size from text size setting

This commit is contained in:
Chumva 2018-09-21 12:59:02 +03:00
parent e3d08d6cce
commit 135ff3dac1

View file

@ -62,6 +62,7 @@ public class MapTextLayer extends OsmandMapLayer {
continue; continue;
} }
updateTextSize();
paintTextIcon.setFakeBoldText(provider.isFakeBoldText()); paintTextIcon.setFakeBoldText(provider.isFakeBoldText());
for (Object o : textObjects.get(l)) { for (Object o : textObjects.get(l)) {
LatLon loc = provider.getTextLocation(o); LatLon loc = provider.getTextLocation(o);
@ -158,7 +159,7 @@ public class MapTextLayer extends OsmandMapLayer {
public void initLayer(OsmandMapTileView v) { public void initLayer(OsmandMapTileView v) {
this.view = v; this.view = v;
paintTextIcon = new Paint(); paintTextIcon = new Paint();
paintTextIcon.setTextSize(13 * v.getDensity()); updateTextSize();
paintTextIcon.setTextAlign(Align.CENTER); paintTextIcon.setTextAlign(Align.CENTER);
paintTextIcon.setAntiAlias(true); paintTextIcon.setAntiAlias(true);
Map<OsmandMapLayer, Collection<?>> textObjectsLoc = new TreeMap<>(new Comparator<OsmandMapLayer>() { Map<OsmandMapLayer, Collection<?>> textObjectsLoc = new TreeMap<>(new Comparator<OsmandMapLayer>() {
@ -188,4 +189,12 @@ public class MapTextLayer extends OsmandMapLayer {
public boolean drawInScreenPixels() { public boolean drawInScreenPixels() {
return true; 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);
}
}
} }