graphic design tool
git clone https://git.lucas.co/cce-designer.git
fix: draw the params pane controls' rounded backgrounds
The pane renders through ParametersBg's legacy plain-quad view, which
drops Prim::RoundedRect — so dropdowns, buttons, textboxes, checkboxes
and color selectors appeared as bare text. Read the new rounded_quads
companion view and draw it between the panel fill and the flat chrome,
clipped to the pane's scroll viewport (same ±4px bounds plain_quads
clips to).
Co-Authored-By: Claude Fable 5 <[email protected]>
src/render.rs | 34 +++++++++++++++++++++++++++++++++-
1 file changed, 33 insertions(+), 1 deletion(-)
diff --git a/src/render.rs b/src/render.rs
index 7a65405..2ff78c5 100644
--- a/src/render.rs
+++ b/src/render.rs
@@ -21,7 +21,7 @@ use cce_ui::vk::TextSpan;
use cce_ui::engine::{
push_widget_vertices, push_extra_quad_vertices,
push_extra_quad_vertices_clipped, push_arc_background_vertices,
- push_plate_solid_border_vertices,
+ push_plate_solid_border_vertices, push_rounded_rect_vertices_corners,
};
impl State {
@@ -341,6 +341,38 @@ impl State {
} else {
push_widget_vertices(w, sw, sh, active_clip_circle, verts);
+ // The params pane serves its chrome through the legacy plain-quad view,
+ // which carries flat quads only — the controls' rounded-rect backgrounds
+ // (textbox/dropdown/button/checkbox/color) come from the rounded view,
+ // drawn under the flat chrome and clipped to the pane's scroll viewport.
+ if idx == PARAM_IDX {
+ let (px, py, pw, ph) = self.positions[PARAM_IDX];
+ let view = (px, py + 4.0, px + pw, py + ph - 4.0);
+ let param_bg = self
+ .slots
+ .param
+ .as_any()
+ .downcast_ref::<cce_ui::widget::ParametersBg>()
+ .expect("PARAM_IDX must be a ParametersBg");
+ for (qx, qy, qw, qh, qr, qc, corners) in param_bg.rounded_quads(&self.ui_context) {
+ let radii = cce_ui::widget::CornerRadii::new(
+ if corners.0 { qr } else { 0.0 },
+ if corners.1 { qr } else { 0.0 },
+ if corners.2 { qr } else { 0.0 },
+ if corners.3 { qr } else { 0.0 },
+ );
+ push_rounded_rect_vertices_corners(
+ qx, qy, qw, qh,
+ radii,
+ sw, sh,
+ qc,
+ active_clip_circle,
+ Some(view),
+ verts,
+ );
+ }
+ }
+
for (qx, qy, qw, qh, qc) in w.extra_quads() {
push_extra_quad_vertices(w, qx, qy, qw, qh, sw, sh, qc, active_clip_circle, verts);
}