mirror of
https://github.com/storytold/deckcraft.git
synced 2026-10-24 10:37:03 -06:00
Fix up #67: use get_mut in the outline-morph cache instead of indexing
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
adf273bf4d
commit
0e51b7b1fc
@@ -76,9 +76,12 @@ impl Cache {
|
||||
self.morphs.len() - 1
|
||||
}
|
||||
};
|
||||
let (_, m, used) = &mut self.morphs[k];
|
||||
*used = true;
|
||||
let scale = |x: Xfrm| Vec2::new(ratio(w, x.w), ratio(h, x.h));
|
||||
let Some((_, m, used)) = self.morphs.get_mut(k) else {
|
||||
// Not reachable (k was just found or pushed); align afresh rather than panic.
|
||||
return Source::of(pm, s).build().at(pm.t, scale(pm.from_box), scale(pm.to_box));
|
||||
};
|
||||
*used = true;
|
||||
m.at(pm.t, scale(pm.from_box), scale(pm.to_box))
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user