Factor in artboard clipping to the click target x-ray function (#2028)

* Add clipping to the click xray function

* Clip area rays as well

* Code review nits

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
This commit is contained in:
James Lindsay 2024-10-13 00:38:17 +01:00 committed by GitHub
parent 3b0e9587eb
commit d6f46f73da
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
11 changed files with 204 additions and 57 deletions

View file

@ -19,7 +19,7 @@ use graphene_core::{Color, WasmNotSend};
use base64::Engine;
#[cfg(target_arch = "wasm32")]
use glam::DAffine2;
use std::collections::HashMap;
use std::collections::{HashMap, HashSet};
use std::sync::Arc;
#[cfg(target_arch = "wasm32")]
use wasm_bindgen::Clamped;
@ -225,6 +225,7 @@ async fn render<'a: 'n, T: 'n + GraphicElementRendered + WasmNotSend>(
let mut metadata = RenderMetadata {
footprints: HashMap::new(),
click_targets: HashMap::new(),
clip_targets: HashSet::new(),
};
data.collect_metadata(&mut metadata, footprint, None);