mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-10-29 04:07:12 -06:00
eps: rustfmt the layer transparency change
This commit is contained in:
@@ -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));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user