eps: rustfmt the layer transparency change

This commit is contained in:
bflatastic
2026-10-16 03:36:19 +07:00
parent 6feec01d85
commit 312a939646
2 changed files with 3 additions and 6 deletions
+2 -2
View File
@@ -1500,8 +1500,8 @@ impl<'a> Reader<'a> {
// After a layer's art and before its `LB`: the layer's own state (#2003). Kept until
// an operator that isn't part of the state block (or the `LB` that takes it) says the
// art moves on, so a path's state before its paint isn't read as its layer's.
self.layer_state = matches!(self.frames.last(), Some(Frame { kind: Kind::Layer(_), .. }))
.then_some((gs.opacity, gs.blend, gs.isolate, gs.knockout));
self.layer_state =
matches!(self.frames.last(), Some(Frame { kind: Kind::Layer(_), .. })).then_some((gs.opacity, gs.blend, gs.isolate, gs.knockout));
}
}
+1 -4
View File
@@ -315,10 +315,7 @@ fn a_layer_keeps_its_own_transparency() {
// The art inside keeps its own state.
assert_eq!(art(&doc)[0].opacity, 1.0);
// A layer whose last object is a group keeps that group's state apart from the layer's.
let art_ = format!(
"0 Ae\nu\n0 0.5 0 0 0 Xy\n{}f\nU\n0 0 Xd\n6 () XW\n",
rect_path(0.0, 0.0, 10.0, 10.0)
);
let art_ = format!("0 Ae\nu\n0 0.5 0 0 0 Xy\n{}f\nU\n0 0 Xd\n6 () XW\n", rect_path(0.0, 0.0, 10.0, 10.0));
let doc = read_ok(&layer(&art_)).doc;
assert_eq!(doc.layers[0].opacity, 1.0, "no layer state written: the layer stays opaque");
assert_eq!(art(&doc)[0].opacity, 0.5, "the group's own state");