From 5bde4e0b4a1b13f8aac3cb986556af55233e8e8f Mon Sep 17 00:00:00 2001 From: a1denvalu3 Date: Thu, 30 Jul 2026 14:29:22 +0200 Subject: [PATCH] Close fully visible geohash outlines --- .../com/bitchat/android/ui/globe/GlobeView.kt | 13 ++++++-- .../android/ui/globe/GlobeGeometryTest.kt | 31 +++++++++++++++++++ 2 files changed, 42 insertions(+), 2 deletions(-) create mode 100644 app/src/test/kotlin/com/bitchat/android/ui/globe/GlobeGeometryTest.kt diff --git a/app/src/main/java/com/bitchat/android/ui/globe/GlobeView.kt b/app/src/main/java/com/bitchat/android/ui/globe/GlobeView.kt index e7717735..619973be 100644 --- a/app/src/main/java/com/bitchat/android/ui/globe/GlobeView.kt +++ b/app/src/main/java/com/bitchat/android/ui/globe/GlobeView.kt @@ -421,7 +421,7 @@ private fun DrawScope.drawGraticule( drawPath(path, color, style = Stroke(width = 1f)) } -private data class DiscPt(val x: Float, val y: Float, val front: Boolean) +internal data class DiscPt(val x: Float, val y: Float, val front: Boolean) private fun limbPoint(behind: DiscPt, front: DiscPt): Pair { var lo = 0f; var hi = 1f @@ -440,7 +440,10 @@ private fun limbPoint(behind: DiscPt, front: DiscPt): Pair { * padded with the horizon intersection point so they can be closed along the horizon. * Pass [closed] = false for open polylines (border lines). */ -private fun buildFrontRuns(pts: List, closed: Boolean = true): List>> { +internal fun buildFrontRuns( + pts: List, + closed: Boolean = true +): List>> { if (pts.isEmpty()) return emptyList() val n = pts.size val runs = mutableListOf>>() @@ -477,6 +480,12 @@ private fun buildFrontRuns(pts: List, closed: Boolean = true): List