From a4dc11ce8d3c0409e69c114bb354bedc3220ce2c Mon Sep 17 00:00:00 2001 From: sonora Date: Sun, 1 Feb 2015 12:29:29 +0100 Subject: [PATCH] fix order again --- OsmAnd/src/net/osmand/plus/views/controls/RulerControl.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/views/controls/RulerControl.java b/OsmAnd/src/net/osmand/plus/views/controls/RulerControl.java index ec80861d71..12d58cf5f8 100644 --- a/OsmAnd/src/net/osmand/plus/views/controls/RulerControl.java +++ b/OsmAnd/src/net/osmand/plus/views/controls/RulerControl.java @@ -60,6 +60,8 @@ public class RulerControl extends MapControls { return; } OsmandMapTileView view = mapActivity.getMapView(); + boolean isNight = nightMode == null ? false : nightMode.isNightMode(); + // update cache if (view.isZooming()) { cacheRulerText = null; @@ -76,6 +78,7 @@ public class RulerControl extends MapControls { int cacheRulerDistPix = (int) (pixDensity * roundedDist); cacheRulerText = ShadowText.create(OsmAndFormatter.getFormattedDistance((float) roundedDist, view.getApplication())); cacheRulerTextLen = rulerTextPaint.measureText(cacheRulerText.getText()); + rulerDrawable = (isNight ? mapActivity.getResources().getDrawable(R.drawable.ruler_night) : mapActivity.getResources().getDrawable(R.drawable.ruler)); Rect bounds = rulerDrawable.getBounds(); bounds.right = (int) (view.getWidth() - 7 * scaleCoefficient); bounds.left = bounds.right - cacheRulerDistPix; @@ -84,8 +87,6 @@ public class RulerControl extends MapControls { } if (cacheRulerText != null) { - boolean isNight = nightMode == null ? false : nightMode.isNightMode(); - //rulerDrawable = (isNight ? mapActivity.getResources().getDrawable(R.drawable.ruler_night) : mapActivity.getResources().getDrawable(R.drawable.ruler)); Rect bounds = rulerDrawable.getBounds(); int bottom = (int) (view.getHeight() - vmargin); if(bounds.bottom != bottom) {