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

pull/35068/head
Cameron Clough 22 hours ago
parent c961fb095f
commit 3436dde6cf
  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._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._offset.y = -max(self._content_rect.height - self._textarea_rect.height, 0)
def render(self):
scroll = self._scroll_panel.handle_scroll(self._textarea_rect, self._content_rect)

Loading…
Cancel
Save