Replace Instances<T>::empty() with Instances<T>::default() and make it return an empty table for vector data instead of one empty row (#2689)

Make Instances<T>::default() return an empty table for everything, even vector, and replace ::empty() with ::default()
This commit is contained in:
Keavon Chambers 2025-06-04 21:00:21 -07:00 committed by GitHub
parent cb4289169d
commit 2696abc6b3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
18 changed files with 110 additions and 115 deletions

View file

@ -179,7 +179,7 @@ where
if footprint.transform.matrix2.determinant() == 0. {
log::trace!("Invalid footprint received for rasterization");
return ImageFrameTable::empty();
return ImageFrameTable::default();
}
let mut render = SvgRender::new();
@ -218,7 +218,7 @@ where
let rasterized = context.get_image_data(0., 0., resolution.x as f64, resolution.y as f64).unwrap();
let mut result = ImageFrameTable::empty();
let mut result = ImageFrameTable::default();
result.push(Instance {
instance: Image::from_image_data(&rasterized.data().0, resolution.x as u32, resolution.y as u32),
transform: footprint.transform,