ui(raylib): start scroll at bottom of text window (#35068)

pull/35069/head
Cameron Clough 19 hours ago committed by GitHub
parent c961fb095f
commit 92ada2170f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 1
      system/ui/text.py

@ -48,6 +48,7 @@ class TextWindow:
self._wrapped_lines = wrap_text(text, FONT_SIZE, self._textarea_rect.width - 20) self._wrapped_lines = wrap_text(text, FONT_SIZE, self._textarea_rect.width - 20)
self._content_rect = rl.Rectangle(0, 0, self._textarea_rect.width - 20, len(self._wrapped_lines) * LINE_HEIGHT) self._content_rect = rl.Rectangle(0, 0, self._textarea_rect.width - 20, len(self._wrapped_lines) * LINE_HEIGHT)
self._scroll_panel = GuiScrollPanel(show_vertical_scroll_bar=True) self._scroll_panel = GuiScrollPanel(show_vertical_scroll_bar=True)
self._scroll_panel._offset.y = -max(self._content_rect.height - self._textarea_rect.height, 0)
def render(self): def render(self):
scroll = self._scroll_panel.handle_scroll(self._textarea_rect, self._content_rect) scroll = self._scroll_panel.handle_scroll(self._textarea_rect, self._content_rect)

Loading…
Cancel
Save