ui: fix 1px overshoot on NavWidget show (#37593)

fix
This commit is contained in:
Shane Smiskol
2026-03-07 02:55:10 -08:00
committed by GitHub
parent 6607283cec
commit e35513afc4
+3 -1
View File
@@ -149,8 +149,9 @@ class NavWidget(Widget, abc.ABC):
new_y = self._rect.height + DISMISS_PUSH_OFFSET
new_y = round(self._y_pos_filter.update(new_y))
if abs(new_y) < 1 and self._y_pos_filter.velocity.x == 0.0:
if abs(new_y) < 1 and abs(self._y_pos_filter.velocity.x) < 0.5:
new_y = self._y_pos_filter.x = 0.0
self._y_pos_filter.velocity.x = 0.0
if self._shown_callback is not None:
self._shown_callback()
@@ -223,6 +224,7 @@ class NavWidget(Widget, abc.ABC):
# Start NavWidget off-screen, no matter how tall it is
self._y_pos_filter.update_alpha(0.1)
self._y_pos_filter.x = gui_app.height
self._y_pos_filter.velocity.x = 0.0
self._nav_bar_y_filter.x = -NAV_BAR_MARGIN - NAV_BAR_HEIGHT
self._nav_bar_show_time = rl.get_time()