Merge pull request #18409

Co-authored-by: autocraft-bot[bot] <354215646+autocraft-bot[bot]@users.noreply.github.com>
This commit is contained in:
davidmann4andautocraft-bot[bot] authored and autocraft-bot[bot] committed 2026-12-02 01:07:07 +00:00
commit 2cc1b98562
1 file changed
+15 -3
+15 -3
View File
@@ -532,9 +532,21 @@ mod tests {
assert!(read_radius(sigma(25.0, bounds)) > 97);
let area = output_area(&p, s.content_bounds(), bounds, None);
let full = apply_tiled(&s, &p, area, bounds, None, 4096, None);
let tiled = apply_tiled(&s, &p, area, bounds, None, 128, None);
let inner = Rect::new(0, 0, size, size);
let d = max_diff(&full.read_region(inner), &tiled.read_region(inner));
// Keep every tile that contributes checked pixels, including each edge tile's
// original rectangle and halo. The remaining tiles lie wholly outside the canvas.
let tile = 128;
let tile_start = |pixel: i32, origin: i32| origin + (pixel - origin).div_euclid(tile) * tile;
let visible_tiles = Rect::new(
tile_start(bounds.x0, area.x0),
tile_start(bounds.y0, area.y0),
tile_start(bounds.x1 - 1, area.x0) + tile,
tile_start(bounds.y1 - 1, area.y0) + tile,
)
.intersect(&area);
let tiled = apply_tiled(&s, &p, visible_tiles, bounds, None, tile, None);
let center = size / 2;
assert!(max_diff(&full.pixel(center, center), &s.pixel(center, center)) > 1e-4, "the full frame must be relit");
let d = max_diff(&full.read_region(bounds), &tiled.read_region(bounds));
assert!(d <= 1e-4, "tile seam {d}");
}