git.lucas.co / cce-designer
graphic design tool
git clone https://git.lucas.co/cce-designer.git

commit10b52b03dcd0b387ea3296382eb669ff60084ba9
parentfb83c0ceea
authorLucas Galante <lsgalante12@gmail.com>
date2026-10-06 21:20
fix(render): a raised scrollbar no longer stacks on its idle copy

The idle copy behind the plate fades out as the fore copy fades in, in
the params HUD and the spreadsheet, so a raised bar is the fore copy
alone rather than two layers read as nearly opaque.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

 CLAUDE.md     |  3 +++
 src/render.rs | 12 +++++++++---
 2 files changed, 12 insertions(+), 3 deletions(-)

diff --git a/CLAUDE.md b/CLAUDE.md
index aefe7ee..e45798f 100644
--- a/CLAUDE.md
+++ b/CLAUDE.md
@@ -2337,6 +2337,9 @@ of these follow). The PARAM_IDX arm draws the idle copy of
 `ParametersBg::scrollbar_quads` before the plate every frame and the fore
 copy after the rows at `scrollbar_fade()`, where it drew ONE copy on
 either side of the plate by the latch, so a raise and a sink were a flip.
+Both panes draw the idle copy at `1 - fade` (since 2026-10-06): at full
+strength it showed through the plate under a raised bar, and the two
+stacked into a bar that read nearly opaque.
 
 ### An edit is in from the next frame
 
diff --git a/src/render.rs b/src/render.rs
index 84d19c5..105f485 100644
--- a/src/render.rs
+++ b/src/render.rs
@@ -475,10 +475,13 @@ impl State {
             // The scrollbar cross's idle copy, BEHIND the plate — the params
             // pane's straddle: the frosted plate dims it, and the widget
             // fades its fore copy in over the cells when a scroll raises it.
+            // The idle copy fades OUT as the fore copy fades in: left at full
+            // strength it showed through the plate under the raised bar and
+            // the two stacked, so a raised bar read nearly opaque.
             let sheet = self.slots.spreadsheet();
             let sheet_rect = rect(wx, wy, ww2, wh2);
             if sheet.scrollbars_shown(sheet_rect) {
-                sheet.paint_scrollbars(sheet_rect, pc, 1.0);
+                sheet.paint_scrollbars(sheet_rect, pc, 1.0 - sheet.scrollbar_fade());
             }
             append_widget_plate_radii(w, pc, self.plate_focus_tint(idx), self.pane_plate_radii(wx, wy, ww2, wh2));
             w.paint_self(&self.ui_context, pc);
@@ -739,8 +742,11 @@ impl State {
             // corners rounding from the pane's toward half its side.
             if let Some(([fx, fy, fw, fh, round], r)) = self.params_plate_drawn() {
                 if round < 0.5 {
-                    if let Some((quads, _)) = &param_scrollbar {
-                        for &(qx, qy, qw, qh, qc) in quads {
+                    // The idle copy fades out as the fore copy fades in, as
+                    // the spreadsheet's does, so the two never stack.
+                    if let Some((quads, fade)) = &param_scrollbar {
+                        for &(qx, qy, qw, qh, mut qc) in quads {
+                            qc[3] *= 1.0 - fade;
                             pc.rounded_rect(rect(qx, qy, qw, qh), qw.min(qh) * 0.5, (true, true, true, true), qc);
                         }
                     }