Skip to content

Conversation

@deanlee
Copy link
Contributor

@deanlee deanlee commented Nov 22, 2025

UnifiedLabel setters now skip updates when values haven't changed, avoiding unnecessary cache invalidation and text re-layout.

These setters are frequently called from render loops (e.g.,

self._alert_text1_label.set_text(alert_text1)
self._alert_text1_label.set_text_color(color)
self._alert_text1_label.set_font_size(font_size)
self._alert_text1_label.set_alignment(rl.GuiTextAlignment.TEXT_ALIGN_LEFT if icon_side != 'left' else rl.GuiTextAlignment.TEXT_ALIGN_RIGHT)
self._alert_text1_label.render(text_rect1)
), which previously forced a full text re-layout every frame. This change removes that overhead and improves render efficiency.

@deanlee deanlee changed the title ui: avoid unnecessary text cache invalidation in ui: avoid unnecessary text cache invalidation in UnifiedLabel Nov 22, 2025
@github-actions github-actions bot added the ui label Nov 22, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Nov 22, 2025

raylib UI Preview

All Screenshots

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant