mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-16 06:38:03 +08:00
Fix regresion from #2265 causing an extra default artboard to show up
This commit is contained in:
@@ -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())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user