GPU-accelerated UI toolkit (Vulkan)
git clone https://git.lucas.co/cce-ui.git
graph: cells and cell cursors share the node corner radius
Grid cells derived their rounding from the plate radius scaled by grid size
(plate_corner_radius * cell/512 * span), so cells, the node bodies sitting
on them, and the hosts' cell cursors each rounded differently — and the cell
value drifted with grid dimensions. cell_corner_radius now returns the node
radius (graph_node_corner_radius, still clamped to half the cell and gated
by the same grid-visibility checks), which unifies all three in every
consumer: the designer's cell tiles and empty-cell cursor read this value,
its node bodies and on-node cursor already used the node radius, and the
widget's internal paint (cce-files network page, cce-graph) drew nodes with
the node radius already.
src/widget/display/graph.rs | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/src/widget/display/graph.rs b/src/widget/display/graph.rs
index 3b55c99..90e8386 100644
--- a/src/widget/display/graph.rs
+++ b/src/widget/display/graph.rs
@@ -324,8 +324,13 @@ impl Graph {
return 0.0;
}
let cell = self.grid_size_x.min(self.grid_size_y);
- (crate::layout::plate_corner_radius() * (cell / 512.0) * crate::layout::corner_span_factor())
- .min(cell / 2.0)
+ // The NODE radius, not a scaled-down plate radius: nodes, grid cells
+ // and the hosts' cell cursors (the designer's empty-cell cursor reads
+ // this) share one corner language. The old derivation
+ // (plate_corner_radius * cell/512 * span) gave cells a different,
+ // grid-size-dependent rounding that never matched the node bodies
+ // sitting on them.
+ crate::layout::graph_node_corner_radius().min(cell / 2.0)
}
/// The wires / connection preview / grid cells / axes / node bodies / toggles as plain