fix(hatch): pick points stay fast in large drawings, and see off layers

Each picked region matched every edge of its rings against every
boundary source of the drawing, twice: with 65,000 sources a click took
over 30 seconds. Sources are now narrowed to those reaching the rings'
box first, once per hatch and once per ring: the same click takes 9 ms.

Objects on layers that are turned off (not frozen) now bound a hatch, as
in the reference. Drawings switch off the layers that close the regions
to be hatched; without them a click between columns found the outer
frame instead. (#1813)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Hakan SevenandClaude Opus 5.5 committed 2026-10-15 23:51:38 +03:00
1 parent d67fd101b4
commit d2995ecee1
3 files changed
+70 -7

No files matched your search

+7 -6
View File
@@ -350,12 +350,13 @@ impl HatchCommand {
.into_iter()
.map(|depth| depth == 0)
.collect();
let near = crate::scene::sources_near_rings(&rings, &self.boundary_sources, 1.0e-6);
let mut boundary_sources: Vec<Vec<Handle>> = rings
.iter()
.map(|ring| crate::scene::ring_source_handles(ring, &self.boundary_sources))
.map(|ring| crate::scene::ring_source_handles(ring, &near))
.collect();
let mut boundary_paths =
crate::scene::exact_hatch_paths(&rings, &exterior, &self.boundary_sources, 1.0e-6);
let mut boundary_paths = crate::scene::exact_hatch_paths(&rings, &exterior, &near, 1.0e-6);
if !self.associative {
for handles in &mut boundary_sources {
handles.clear();
@@ -983,12 +984,12 @@ impl GradientCommand {
.into_iter()
.map(|depth| depth == 0)
.collect();
let near = crate::scene::sources_near_rings(&rings, &self.boundary_sources, 1.0e-6);
let boundary_sources = rings
.iter()
.map(|ring| crate::scene::ring_source_handles(ring, &self.boundary_sources))
.map(|ring| crate::scene::ring_source_handles(ring, &near))
.collect();
let boundary_paths =
crate::scene::exact_hatch_paths(&rings, &exterior, &self.boundary_sources, 1.0e-6);
let boundary_paths = crate::scene::exact_hatch_paths(&rings, &exterior, &near, 1.0e-6);
HatchModel {
pattern_origin: None,
render_instance: None,