@@ -20,7 +20,7 @@ import com.kylecorry.sol.math.interpolation.Interpolation
2020import com.kylecorry.sol.science.geology.CoordinateBounds
2121import com.kylecorry.sol.units.Coordinate
2222import com.kylecorry.trail_sense.shared.canvas.LineClipper
23- import com.kylecorry.trail_sense.shared.extensions.DEFAULT_LINE_STRING_STROKE_WEIGHT_PX
23+ import com.kylecorry.trail_sense.shared.extensions.DEFAULT_LINE_STRING_STROKE_WEIGHT_DP
2424import com.kylecorry.trail_sense.shared.extensions.drawLines
2525import com.kylecorry.trail_sense.shared.extensions.getColor
2626import com.kylecorry.trail_sense.shared.extensions.getLineStyle
@@ -152,7 +152,7 @@ class GeoJsonLineStringRenderer : FeatureRenderer() {
152152 it.getColor() ? : Color .WHITE ,
153153 it.getLineStyle() ? : LineStyle .Solid ,
154154 (it.getStrokeWeight()
155- ? : DEFAULT_LINE_STRING_STROKE_WEIGHT_PX ) / DEFAULT_LINE_STRING_STROKE_WEIGHT_PX ,
155+ ? : DEFAULT_LINE_STRING_STROKE_WEIGHT_DP ) / DEFAULT_LINE_STRING_STROKE_WEIGHT_DP ,
156156 path,
157157 projection.center,
158158 projection.metersPerPixel
@@ -209,6 +209,8 @@ class GeoJsonLineStringRenderer : FeatureRenderer() {
209209 filterEpsilon = drawer.dp(2f )
210210 }
211211 val scale = map.layerScale
212+ // Paths were originally 6px, so convert that to the default dp size
213+ val dpScale = drawer.dp(DEFAULT_LINE_STRING_STROKE_WEIGHT_DP ) / 6f
212214 synchronized(lock) {
213215 for (path in reducedPaths) {
214216 if (path.line.isEmpty()) {
@@ -229,7 +231,7 @@ class GeoJsonLineStringRenderer : FeatureRenderer() {
229231 factory.create(LineStyle .Solid ).draw(
230232 drawer,
231233 backgroundColor,
232- strokeScale = 0.75f * relativeScale * scale / path.thicknessScale
234+ strokeScale = dpScale * 0.75f * relativeScale * scale / path.thicknessScale
233235 ) {
234236 if (shouldRenderWithDrawLines) {
235237 lines(path.line)
@@ -242,7 +244,7 @@ class GeoJsonLineStringRenderer : FeatureRenderer() {
242244 pathDrawer.draw(
243245 drawer,
244246 path.color,
245- strokeScale = relativeScale * scale / path.thicknessScale
247+ strokeScale = dpScale * relativeScale * scale / path.thicknessScale
246248 ) {
247249 if (shouldRenderWithDrawLines) {
248250 lines(path.line)
0 commit comments