file manager
git clone https://git.lucas.co/cce-files.git
fix: stop drawing the view dropdown twice per frame
`rebuild_layout` rendered `view_dropdown` into `window_pc` and then every
page's `view()` rendered the same widget again into the page content. The
first copy was drawn at `view_dropdown.rect()` — the rect the pages
assigned on the PREVIOUS frame, the same staleness e256b55 fixed for the
relief — so through a resize the two copies sat at different positions.
What the second draw actually contributed, in steady state, was weight:
the flat path emits no background quad for a raised dropdown, so the only
thing landing twice was the label and the ▼ arrow, whose antialiased
edges composited into a faux-bold. Pixel-diffing the two builds isolates
the change to exactly the glyph outlines (bright edge px 487 -> 444, and
the diff image is a hollow outline of "List" and the arrow); the groove
ring, the lip and every other part of the window are untouched.
Registration is unaffected — `register_widget` for the dropdown already
happens above, and the pages lay it out. Live-verified after the removal:
the menu opens on click, selecting Space switches the page, and the
dropdown's relief tracks it to the different coordinates that page uses.
src/main.rs | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/src/main.rs b/src/main.rs
index 95f9003..f58ff5e 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -499,8 +499,10 @@ impl FilesystemApp {
let self_ptr = self as *mut Self;
unsafe {
let mut plain_pc = pages::PageContent::new();
- let (x, y, w, h) = (*self_ptr).view_dropdown.rect();
- cce_ui::layout::render_widget(&mut plain_pc, &mut (*self_ptr).view_dropdown, x, y, w, h, &mut self.ui_context);
+ // NOT the view dropdown: every page's `view()` already renders
+ // it, so a copy here was a second draw of the same widget — at
+ // the previous frame's rect, and compositing its label's
+ // antialiased edges twice into a faux-bold.
// The dissolved splitter's paint: its divider quad, then the preview
// pane (the only pane content the pages don't render themselves). The
// left pane's container copy is gone — the legacy aggregate painted it