raylib: don't use time.time() (#35597)

Update inputbox.py
pull/33601/merge
Shane Smiskol 2 days ago committed by GitHub
parent 01b3f70c01
commit a22eecd773
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 4
      system/ui/lib/inputbox.py

@ -81,7 +81,7 @@ class InputBox(Widget):
self.set_cursor_position(self._cursor_position + 1) self.set_cursor_position(self._cursor_position + 1)
if self._password_mode: if self._password_mode:
self._last_char_time = time.time() self._last_char_time = time.monotonic()
return True return True
return False return False
@ -161,7 +161,7 @@ class InputBox(Widget):
# Show character at last edited position if within delay window # Show character at last edited position if within delay window
masked_text = PASSWORD_MASK_CHAR * len(self._input_text) masked_text = PASSWORD_MASK_CHAR * len(self._input_text)
recent_edit = time.time() - self._last_char_time < PASSWORD_MASK_DELAY recent_edit = time.monotonic() - self._last_char_time < PASSWORD_MASK_DELAY
if recent_edit and self._input_text: if recent_edit and self._input_text:
last_pos = max(0, self._cursor_position - 1) last_pos = max(0, self._cursor_position - 1)
if last_pos < len(self._input_text): if last_pos < len(self._input_text):

Loading…
Cancel
Save