only change orientation if course is > 20 degrees off

means we don't spin around quite as much, which is nice
This commit is contained in:
Daniel Barlow 2025-06-09 22:15:54 +01:00
parent eaa4ad895f
commit 6c3f019ab7

View File

@ -302,9 +302,10 @@ label.readout {
(when (not (bounds= old-bounds bounds)) (when (not (bounds= old-bounds bounds))
(fetch-tiles bounds app-state.tiles app-state.zoom) (fetch-tiles bounds app-state.tiles app-state.zoom)
(set map-surface nil))) (set map-surface nil)))
(set app-state.orientation (when (> (math.abs (- app-state.orientation app-state.course)) 20)
(+ app-state.orientation (set app-state.orientation
(* 0.05 (- app-state.course app-state.orientation)))) (+ app-state.orientation
(* 0.05 (- app-state.course app-state.orientation)))))
(each [name widget (pairs state-widgets)] (each [name widget (pairs state-widgets)]
(case name (case name
:speed (widget:set_label :speed (widget:set_label