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

@deanlee deanlee force-pushed the ui-avoid-cache-invalidation branch from 7fa19ed to f8c5fd0 Compare November 27, 2025 05:32
@sshane sshane merged commit 630e14f into commaai:master Nov 27, 2025
10 of 11 checks passed
@deanlee deanlee deleted the ui-avoid-cache-invalidation branch November 27, 2025 10:32
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.

2 participants