Navigator: cached raster effects follow Draw Dashed Lines as Solid Lines

The raster-effect cache key now includes the setting, so a renderer that
draws the same art with it on and then off no longer reuses a drop
shadow or other raster effect made with the other setting.
This commit is contained in:
dotCooCoo
2026-11-04 18:29:29 +07:00
committed by bflatastic
parent ddf3373cf0
commit 6fa0d6e4e0
2 changed files with 9 additions and 1 deletions
+6
View File
@@ -1321,6 +1321,12 @@ fn solid_dashes_draw_dashed_strokes_as_solid_lines() {
assert_eq!(draw(&line(true, shadow), true).pixels, solid.pixels, "the dashes go with the option (shadow: {shadow})");
assert_eq!(draw(&line(false, shadow), true).pixels, solid.pixels, "a solid stroke is unchanged (shadow: {shadow})");
}
// One renderer that draws the shadow both ways makes its raster again for each setting.
let (dashed, mut r) = (line(true, true), Renderer::new());
let fresh = |solid: bool| draw(&dashed, solid).pixels;
for solid in [false, true, false] {
assert_eq!(r.render(&dashed, 100, 100, Affine::IDENTITY, &opts(solid)).pixels, fresh(solid), "reused renderer, solid: {solid}");
}
}
/// An image that can't be decoded is counted on the thread that tried to decode it: an export