graphic design tool
git clone https://git.lucas.co/cce-designer.git
Node bodies get their own backdrop compression (graph node_compression)
The nodes wear the pane material, so with the plates tuned clear the
tablets sitting on them were as clear — nothing to read them by.
style.surface.graph.node_compression (0..1) overrides the frost's
compression for node bodies only: the plate keeps passing the scene
through while a node pulls it toward the tint's key and reads solid.
Unset = the pane's, byte-identical to before.
Co-Authored-By: Claude Fable 5.1 <[email protected]>
src/app.rs | 16 ++++++++++++++++
src/render.rs | 14 ++++++++++++--
2 files changed, 28 insertions(+), 2 deletions(-)
diff --git a/src/app.rs b/src/app.rs
index e4473a6..34cdc8b 100644
--- a/src/app.rs
+++ b/src/app.rs
@@ -1259,6 +1259,12 @@ pub struct State {
/// Node-domain opacity (style.surface.graph.node.opacity) — independent of
/// the pane's network_opacity; fades node bodies/wires/ports and node text.
pub node_opacity: f32,
+ /// The node bodies' own backdrop compression (`style.surface.graph.
+ /// node_compression`, 0..1), overriding the pane material's for nodes
+ /// only — the plates can stay clear while the tablets sitting on them
+ /// pull the view toward the tint's key and read as solid. None = the
+ /// pane's.
+ pub node_compression: Option<f32>,
pub last_design_mod_time: Option<std::time::SystemTime>,
pub last_config_mod_time: Option<std::time::SystemTime>,
pub floating_network_layout: (f32, f32, f32, f32),
@@ -4225,6 +4231,7 @@ pub(crate) fn geometry_to_spreadsheet_data(geom: &Detail) -> (Vec<String>, Vec<V
uniform_background: true,
network_opacity: 0.95,
node_opacity: 1.0,
+ node_compression: None,
last_design_mod_time: {
let design_path = DesignSettings::file_path();
std::fs::metadata(&design_path).and_then(|m| m.modified()).ok()
@@ -4474,8 +4481,17 @@ pub(crate) fn geometry_to_spreadsheet_data(geom: &Detail) -> (Vec<String>, Vec<V
let gap_color = cce_ui::color::graph_gap_color();
let snap_enabled = cce_ui::layout::graph_grid_snap();
let node_color = cce_ui::color::graph_node_color();
+ let node_compression = cce_ui::config::cached_config()
+ .pointer("/style/surface/graph/node_compression")
+ .and_then(|v| v.as_f64())
+ .map(|k| (k as f32).clamp(0.0, 1.0));
let mut changed = false;
+
+ if self.node_compression != node_compression {
+ self.node_compression = node_compression;
+ changed = true;
+ }
if (self.network_opacity - opacity).abs() > 0.001 {
self.network_opacity = opacity;
diff --git a/src/render.rs b/src/render.rs
index 0870bef..4135c1e 100644
--- a/src/render.rs
+++ b/src/render.rs
@@ -439,6 +439,16 @@ impl State {
// a tighter lip keeps the flat face reading.
let node_bevel = cce_ui::colors::plate_bevel_width() * 0.5;
let node_fill = cce_ui::colors::param_plate_fill();
+ // The pane material, with the nodes' own compression when
+ // configured (State::node_compression): the one knob that
+ // differs between a node body and the plate it sits on.
+ let node_mat = {
+ let mut m = cce_ui::scene::Material::from_fill(node_fill);
+ if let (Some(k), cce_ui::scene::Frost::Frosted { compression, .. }) = (self.node_compression, &mut m.frost) {
+ *compression = k;
+ }
+ m
+ };
let sel = cce_ui::colors::node_selected_color();
let drag = cce_ui::colors::node_drag_color();
let hl = cce_ui::colors::highlight_primary_color();
@@ -490,9 +500,9 @@ impl State {
}
for (qx, qy, qw, qh, highlighted) in bodies {
if highlighted {
- pc.bevel_tinted(rect(qx, qy, qw, qh), radii, &cce_ui::scene::Material::from_fill(node_fill), node_bevel, hl_tint);
+ pc.bevel_tinted(rect(qx, qy, qw, qh), radii, &node_mat, node_bevel, hl_tint);
} else {
- pc.bevel(rect(qx, qy, qw, qh), radii, &cce_ui::scene::Material::from_fill(node_fill), node_bevel);
+ pc.bevel(rect(qx, qy, qw, qh), radii, &node_mat, node_bevel);
}
}
for (qx, qy, qw, qh, qc) in overlays {