Fix regresion from #2265 causing an extra default artboard to show up

This commit is contained in:
Keavon Chambers 2025-03-06 22:56:09 -08:00
parent b171eeba84
commit 22a900b35e
2 changed files with 11 additions and 3 deletions

View file

@ -118,9 +118,15 @@ impl<T> Instances<T> {
}
}
impl<T: Default + Hash> Default for Instances<T> {
impl<T: Default + Hash + 'static> Default for Instances<T> {
fn default() -> Self {
Self::new(T::default())
use core::any::TypeId;
if TypeId::of::<T>() == TypeId::of::<crate::Artboard>() {
// TODO: Remove the 'static trait bound when this special casing is removed by making all types return empty
Self::empty()
} else {
Self::new(T::default())
}
}
}