Skip to content

Commit e35513a

Browse files
authored
ui: fix 1px overshoot on NavWidget show (#37593)
fix
1 parent 6607283 commit e35513a

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

system/ui/widgets/nav_widget.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,8 +149,9 @@ def _update_state(self):
149149
new_y = self._rect.height + DISMISS_PUSH_OFFSET
150150

151151
new_y = round(self._y_pos_filter.update(new_y))
152-
if abs(new_y) < 1 and self._y_pos_filter.velocity.x == 0.0:
152+
if abs(new_y) < 1 and abs(self._y_pos_filter.velocity.x) < 0.5:
153153
new_y = self._y_pos_filter.x = 0.0
154+
self._y_pos_filter.velocity.x = 0.0
154155

155156
if self._shown_callback is not None:
156157
self._shown_callback()
@@ -223,6 +224,7 @@ def show_event(self):
223224
# Start NavWidget off-screen, no matter how tall it is
224225
self._y_pos_filter.update_alpha(0.1)
225226
self._y_pos_filter.x = gui_app.height
227+
self._y_pos_filter.velocity.x = 0.0
226228

227229
self._nav_bar_y_filter.x = -NAV_BAR_MARGIN - NAV_BAR_HEIGHT
228230
self._nav_bar_show_time = rl.get_time()

0 commit comments

Comments
 (0)