From 75743caa5340e8d9af6e91386a44c9cd04e6ac24 Mon Sep 17 00:00:00 2001 From: seeebek Date: Fri, 7 Oct 2011 00:30:51 +0800 Subject: [PATCH] small fix. moved repeating part to method. --- .../osmand/plus/render/OsmandRenderer.java | 32 ++++++++----------- 1 file changed, 13 insertions(+), 19 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/render/OsmandRenderer.java b/OsmAnd/src/net/osmand/plus/render/OsmandRenderer.java index b0e9e8588b..62ba1c2abe 100644 --- a/OsmAnd/src/net/osmand/plus/render/OsmandRenderer.java +++ b/OsmAnd/src/net/osmand/plus/render/OsmandRenderer.java @@ -361,7 +361,7 @@ public class OsmandRenderer { int ind = i >> 8; int l = i & 0xff; BinaryMapDataObject obj = objects.get(ind); - + //draw streets with shadow when all have been drawn if(keys[k] > 57 && !streetsdrawn){ drawStreetsShadow(cv, streetbmp); @@ -914,7 +914,12 @@ public class OsmandRenderer { } - + private void drawStreet(Canvas canvas, Path path, float order){ + if((order < 58) && (order > 46)) { + streetcv.drawPath(path, paint); + } + else canvas.drawPath(path, paint); + } private void drawPolyline(BinaryMapDataObject obj, BaseOsmandRender render, Canvas canvas, RenderingContext rc, TagValuePair pair, int layer, float order) { @@ -982,32 +987,21 @@ public class OsmandRenderer { if (path != null) { rc.main.updatePaint(paint); - //changed canvas to the global one for streets - if((order < 58) && (order > 46)) { - streetcv.drawPath(path, paint); - } - else canvas.drawPath(path, paint); + drawStreet(canvas, path, order); + if (rc.second.strokeWidth != 0) { rc.second.updatePaint(paint); - if((order < 58) && (order > 46)) { - streetcv.drawPath(path, paint); - } - else canvas.drawPath(path, paint); + drawStreet(canvas, path, order); + if (rc.third.strokeWidth != 0) { rc.third.updatePaint(paint); - if((order < 58) && (order > 46)) { - streetcv.drawPath(path, paint); - } - else canvas.drawPath(path, paint); + drawStreet(canvas, path, order); } } if (rc.adds != null) { for (int i = 0; i < rc.adds.length; i++) { rc.adds[i].updatePaint(paint); - if((order < 58) && (order > 46)) { - streetcv.drawPath(path, paint); - } - else canvas.drawPath(path, paint); + drawStreet(canvas, path, order); } } if (obj.getName() != null && obj.getName().length() > 0) {