mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-11-26 08:26:04 +00:00
Selection: a click on a drop shadow or glow selects the object under it
Clicks, the hover pointer and marquees with the selection tools already leave out the area that raster effects paint beyond an object. New tests in crates/engine/src/tests/select_effects.rs hold that in place for drop shadows, Outer Glow and Gaussian Blur on paths, groups, point type, symbol art and images, for Shift-click, Direct Selection, the hover pointer, a drag from a selected object's shadow and a marquee. hit_leaf gets a doc comment, and docs/target-app-parity.md gets a line citing https://helpx.adobe.com/illustrator/using/selecting-objects.html.
This commit is contained in:
@@ -795,6 +795,10 @@ thread_local! {
|
||||
static LEAVES_TESTED: std::cell::Cell<usize> = const { std::cell::Cell::new(0) };
|
||||
}
|
||||
|
||||
/// What a click at `p` hits on leaf object `n`: its outline, strokes and fills, its frame or its
|
||||
/// bounds, by kind. Raster effects (drop shadows, glows, blurs) do not take clicks: the area they
|
||||
/// paint beyond the object is left out here and in [`cull_reach`], so a click there reaches the
|
||||
/// object under it.
|
||||
fn hit_leaf(n: &Node, p: Point, opt: HitOptions, symbols: &SymbolBoxes) -> Option<HitKind> {
|
||||
#[cfg(test)]
|
||||
LEAVES_TESTED.with(|c| c.set(c.get() + 1));
|
||||
|
||||
Reference in New Issue
Block a user