From ad1ad279f072b47ca407cc350bdbd931389dd77a Mon Sep 17 00:00:00 2001 From: Kyle Corry Date: Sun, 14 Jan 2024 19:56:48 -0500 Subject: [PATCH] Use average scale for path --- .../kylecorry/trail_sense/navigation/ui/layers/PathLayer.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/com/kylecorry/trail_sense/navigation/ui/layers/PathLayer.kt b/app/src/main/java/com/kylecorry/trail_sense/navigation/ui/layers/PathLayer.kt index d58d2f373..37063522f 100644 --- a/app/src/main/java/com/kylecorry/trail_sense/navigation/ui/layers/PathLayer.kt +++ b/app/src/main/java/com/kylecorry/trail_sense/navigation/ui/layers/PathLayer.kt @@ -155,11 +155,13 @@ class PathLayer : ILayer { synchronized(lock) { lineObj.clear() pathObj?.reset() + val before = currentScale renderer.render(points, lineObj) .copy( style = path.style, color = path.color, - renderedScale = currentScale, + // A best guess at what scale the path was rendered at + renderedScale = (before + currentScale) / 2f, path = pathObj?.also { it.drawLines(lineObj.toFloatArray()) })