no-wrap option; pivoted exponential zoom

This commit is contained in:
Ilia Denisov
2026-03-07 11:35:18 +02:00
committed by GitHub
parent 1de621c743
commit 477e656008
22 changed files with 605 additions and 81 deletions
+3 -3
View File
@@ -217,7 +217,7 @@ func shortestWrappedDelta(from, to, size int) (a int, b int) {
return
}
// cameraZoomToWorldFixed converts a UI-facing zoom multiplier into the package
// CameraZoomToWorldFixed converts a UI-facing zoom multiplier into the package
// fixed-point representation used by world-space calculations.
//
// The input zoom is expected to be a finite positive real value where 1.0 means
@@ -225,7 +225,7 @@ func shortestWrappedDelta(from, to, size int) (a int, b int) {
//
// An error is returned when the input is invalid or when rounding would produce
// a non-positive fixed-point zoom.
func cameraZoomToWorldFixed(cameraZoom float64) (int, error) {
func CameraZoomToWorldFixed(cameraZoom float64) (int, error) {
if cameraZoom <= 0 || math.IsNaN(cameraZoom) || math.IsInf(cameraZoom, 0) {
return 0, errInvalidCameraZoom
}
@@ -242,7 +242,7 @@ func cameraZoomToWorldFixed(cameraZoom float64) (int, error) {
// cameraZoomToWorldFixed. It is intended for internal code paths where invalid
// zoom is considered a programmer or integration error and must fail fast.
func mustCameraZoomToWorldFixed(cameraZoom float64) int {
zoomFp, err := cameraZoomToWorldFixed(cameraZoom)
zoomFp, err := CameraZoomToWorldFixed(cameraZoom)
if err != nil {
panic(err)
}