From bc70c4267d29e528c3c7544208d58beb8e4eb0eb Mon Sep 17 00:00:00 2001 From: Holt59 Date: Sat, 3 Mar 2018 12:48:55 +0100 Subject: [PATCH] Update polyline auto scaling width. --- .../insa/graphics/drawing/overlays/PaintUtils.java | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/main/org/insa/graphics/drawing/overlays/PaintUtils.java b/src/main/org/insa/graphics/drawing/overlays/PaintUtils.java index 3056bbe..427f004 100644 --- a/src/main/org/insa/graphics/drawing/overlays/PaintUtils.java +++ b/src/main/org/insa/graphics/drawing/overlays/PaintUtils.java @@ -22,11 +22,17 @@ public class PaintUtils { * @param width * @return */ - public static int getStrokeWidth(int width, byte zoomLevel) { - int mul = 2; - if (zoomLevel < 8) { + public static float getStrokeWidth(int width, byte zoomLevel) { + float mul = 1; + if (zoomLevel < 6) { mul = 1; } + else if (zoomLevel < 10) { + mul += (zoomLevel - 5) * 0.5; + } + else if (zoomLevel < 13) { + mul = 3.5f; + } else { mul += 2 * (zoomLevel - 8) / 3; }