Appearance: Add New Fill and Add New Stroke comment names the paint they take

The comment in add_item said a new fill or stroke is a copy of the top
one. The code takes only the top item's paint, and for a stroke its
weight. The comment now says so, as the params text does.
This commit is contained in:
dotCooCoo
2026-11-04 23:44:58 +07:00
committed by bflatastic
parent 539195d68b
commit a9eae3a333
+3 -2
View File
@@ -559,8 +559,9 @@ fn add_item(s: &mut Session, p: &Value, fill: bool) -> Result<Value> {
}
continue;
}
// A copy of the top fill (stroke); without one, type's characters' and otherwise the
// default paint, so a new fill on a group or type shows.
// The top fill's (stroke's) paint; without one, type's characters' and otherwise the
// default paint, so a new fill on a group or type shows. A new stroke takes the top
// stroke's weight when that stroke has paint, at least 1 pt.
let paint = match (n.appearance.paint_at(None, fill), &n.kind) {
(Some(p), _) => p.clone(),
(None, NodeKind::Text(_)) => super::paint::proxy_paint(n, !fill, None),