page layout tool
git clone https://git.lucas.co/cce-layout-interface.git
refactor: paginator + word-processor text via the paint walk (Phase 6ao)
The last two text_labels*() getter calls move off the rebuild-time tuple
cache: the paginator tabs and the word-processor TextBox are emitted in
display_list via scene::painter::append_widget_text (fresh per frame, widget
content font + walk clip bounds). A/B: AE=0 byte-identical.
Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_018u7qTwzX95dd5ysAkaSCLk
src/main.rs | 15 +++++++++------
1 file changed, 9 insertions(+), 6 deletions(-)
diff --git a/src/main.rs b/src/main.rs
index 2d1afa4..6b1cd25 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -1042,8 +1042,7 @@ impl LayoutApp {
let page_x = 280.0 + (canvas_w - page_w) / 2.0 + self.pan_x;
let page_y = (canvas_h - page_h) / 2.0 + self.pan_y;
- // 2. Paginator sidebar tabs
- labels.extend(self.paginator.text_labels());
+ // 2. Paginator sidebar tabs: emitted in display_list via the paint walk.
if self.toggle_rulers.toggled() {
let unit_idx = self.dropdown_units.selected;
@@ -1094,10 +1093,7 @@ impl LayoutApp {
// 5. Canvas Element Labels (drawn relative to the paper sheet)
if self.word_processor_enabled {
- let font_family = self.wp_text_box.font_family.clone();
- for (label, bounds) in self.wp_text_box.text_labels_with_bounds(&self.ui_context) {
- self.text_prims.push((label.text, label.font_size, label.x, label.y, label.color, Some(font_family.clone()), bounds, None));
- }
+ // Word-processor text box: emitted in display_list via the paint walk.
} else {
for (idx, element) in self.elements.iter().enumerate() {
match element {
@@ -3400,6 +3396,13 @@ impl Application for LayoutApp {
}
}
+ // Widget text via the paint walk (not the legacy text_labels* getters): the
+ // paginator's sidebar tabs, and the word-processor text box when active.
+ cce_ui::scene::painter::append_widget_text(&self.ui_context, &self.paginator, &mut __pc);
+ if self.word_processor_enabled {
+ cce_ui::scene::painter::append_widget_text(&self.ui_context, &self.wp_text_box, &mut __pc);
+ }
+
Some(__pc.finish())
}