haunt / commit
Fix map scale driven by RTT outliers in history trail
app/src/main/java/net/fuzzyworld/haunt/debug/MapView.kt | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/net/fuzzyworld/haunt/debug/MapView.kt b/app/src/main/java/net/fuzzyworld/haunt/debug/MapView.kt index e623c83..de9b47e 100644 --- a/app/src/main/java/net/fuzzyworld/haunt/debug/MapView.kt +++ b/app/src/main/java/net/fuzzyworld/haunt/debug/MapView.kt @@ -195,9 +195,10 @@ class MapView @JvmOverloads constructor( val padPx = 72f - // Scale is determined by named points + history only — "you" does not expand the viewport. - // This keeps saved points visible and spread out even when you wander far from them. - val anchorCoords = savedCoords.map { it.second } + lightCoords.map { it.second } + historyCoords + // Scale is determined by named points only — history trail and "you" don't expand the viewport. + // History can contain RTT outliers (hundreds of metres) that would collapse the real points + // into a single pixel at the top of the canvas. + val anchorCoords = savedCoords.map { it.second } + lightCoords.map { it.second } val scaleCoords = anchorCoords.ifEmpty { listOfNotNull(currentCoords) } val minX = (scaleCoords.minOf { it.first } - 1.0).coerceAtLeast(0.0)