graphic design tool
git clone https://git.lucas.co/cce-designer.git
Plates, bevels and drops are emitted with a Material (cce-ui RFC material, step 2b)
PaintCtx::plate / bevel / sphere / droplet take a Material now;
Material::from_fill decodes the colour each site already held, so the
bytes the tessellator produces are unchanged. cce-ui@2e1abb3.
Co-Authored-By: Claude Fable 5.1 <[email protected]>
src/dialog.rs | 4 ++--
src/render.rs | 10 +++++-----
2 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/src/dialog.rs b/src/dialog.rs
index 7613dee..363a729 100644
--- a/src/dialog.rs
+++ b/src/dialog.rs
@@ -399,7 +399,7 @@ impl Paint for Dialog {
// "this is the live one": the tinted bevel, a glint on the
// control's own silhouette.
if active {
- ctx.bevel_tinted(r, radii, colors::param_plate_fill(), depth, tint);
+ ctx.bevel_tinted(r, radii, &cce_ui::scene::Material::from_fill(colors::param_plate_fill()), depth, tint);
} else if self.hover_tab == Some(tab) {
ctx.rounded_rect(r, ctrl_r, (true, true, true, true), [1.0, 1.0, 1.0, 0.05]);
}
@@ -474,7 +474,7 @@ impl Paint for Dialog {
let row = &self.rows[i];
if i == self.selected {
ctx.rounded_rect(r, ctrl_r, (true, true, true, true), [accent[0], accent[1], accent[2], 0.16]);
- ctx.bevel_tinted(r, radii, [0.0; 4], depth, tint);
+ ctx.bevel_tinted(r, radii, &cce_ui::scene::Material::from_fill([0.0; 4]), depth, tint);
} else if self.hover_row == Some(i) {
ctx.rounded_rect(r, ctrl_r, (true, true, true, true), [1.0, 1.0, 1.0, 0.05]);
}
diff --git a/src/render.rs b/src/render.rs
index 7660e58..19abc34 100644
--- a/src/render.rs
+++ b/src/render.rs
@@ -390,7 +390,7 @@ impl State {
depth: -depth,
});
if let Some(tint) = self.plate_focus_tint(idx) {
- pc.bevel_tinted(vp_rect, radii, [0.0; 4], depth, tint);
+ pc.bevel_tinted(vp_rect, radii, &cce_ui::scene::Material::from_fill([0.0; 4]), depth, tint);
}
} else {
pc.border(vp_rect, radii, [0.0; 4], bc, cce_ui::colors::plate_border_thickness());
@@ -487,9 +487,9 @@ impl State {
}
for (qx, qy, qw, qh, highlighted) in bodies {
if highlighted {
- pc.bevel_tinted(rect(qx, qy, qw, qh), radii, node_fill, node_bevel, hl_tint);
+ pc.bevel_tinted(rect(qx, qy, qw, qh), radii, &cce_ui::scene::Material::from_fill(node_fill), node_bevel, hl_tint);
} else {
- pc.bevel(rect(qx, qy, qw, qh), radii, node_fill, node_bevel);
+ pc.bevel(rect(qx, qy, qw, qh), radii, &cce_ui::scene::Material::from_fill(node_fill), node_bevel);
}
}
for (qx, qy, qw, qh, qc) in overlays {
@@ -521,11 +521,11 @@ impl State {
let depth = cce_ui::colors::plate_bevel_width();
if self.graph().is_node_rect(cx, cy, cw, ch) {
let r = cce_ui::layout::graph_node_corner_radius();
- pc.bevel_tinted(rect(cx, cy, cw, ch), (r, r, r, r), [0.0; 4], depth, tint);
+ pc.bevel_tinted(rect(cx, cy, cw, ch), (r, r, r, r), &cce_ui::scene::Material::from_fill([0.0; 4]), depth, tint);
} else {
let r = self.graph().cell_corner_radius();
pc.clip(clip, |pc| {
- pc.bevel_tinted(rect(cx, cy, cw, ch), (r, r, r, r), [0.0; 4], depth, tint);
+ pc.bevel_tinted(rect(cx, cy, cw, ch), (r, r, r, r), &cce_ui::scene::Material::from_fill([0.0; 4]), depth, tint);
});
}
}