mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2025-12-23 10:11:54 +00:00
Fix regresion from #2265 causing an extra default artboard to show up
This commit is contained in:
parent
b171eeba84
commit
22a900b35e
2 changed files with 11 additions and 3 deletions
|
|
@ -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())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue