mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-10-31 05:07:51 -06:00
Live Paint: the Live Paint tools skip hidden edges
An edge hidden on its own (for example with Object > Hide) while its Live Paint group stays visible could still be highlighted, selected or stroked, and a hidden edge nearer the pointer kept a visible one from being picked. lp_part_at now takes the nearest visible edge (visible_edge_near), inside and outside the faces, for the hover, the Live Paint Selection click and the Bucket's Shift-click. The Bucket's Shift-click sends nothing where no edge is highlighted, and livePaint.strokeEdge also skips hidden edges, so the Bucket strokes the edge it highlights.
This commit is contained in:
@@ -766,7 +766,7 @@ fn lp_stroke_edge(s: &mut Session, p: &Value) -> Result<Value> {
|
||||
let tol = f64_or(p, "tolerance", 4.0).clamp(0.0, 1000.0);
|
||||
let edge = s.edit("Live Paint Bucket", |d, _| {
|
||||
let n = d.node(g).filter(|n| is_live_paint(n)).ok_or_else(|| bad(C, format!("{g} is not a Live Paint group")))?;
|
||||
let eid = edge_near(n, pt, tol).map(|e| e.id).ok_or_else(|| EngineError::Other("no Live Paint edge near that point".into()))?;
|
||||
let eid = b::visible_edge_near(n, pt, tol).map(|e| e.id).ok_or_else(|| EngineError::Other("no Live Paint edge near that point".into()))?;
|
||||
let e = d.node_mut(eid).ok_or(EngineError::NoNode(eid))?;
|
||||
e.appearance.set_stroke(paint.clone());
|
||||
if let Some(st) = e.appearance.stroke_mut() {
|
||||
|
||||
Reference in New Issue
Block a user