mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Fix amounts out of range
This commit is contained in:
parent
0bb0d5e7a6
commit
6c129c9b8d
@ -583,6 +583,20 @@ impl<'a> Widget for Bag<'a> {
|
||||
.resize(inventory.len(), &mut ui.widget_id_generator());
|
||||
});
|
||||
}
|
||||
if state.ids.amounts.len() < inventory.len() {
|
||||
state.update(|s| {
|
||||
s.ids
|
||||
.amounts
|
||||
.resize(inventory.len(), &mut ui.widget_id_generator());
|
||||
});
|
||||
}
|
||||
if state.ids.amounts_bg.len() < inventory.len() {
|
||||
state.update(|s| {
|
||||
s.ids
|
||||
.amounts_bg
|
||||
.resize(inventory.len(), &mut ui.widget_id_generator());
|
||||
});
|
||||
}
|
||||
// Expand img id cache to the number of slots
|
||||
if state.img_id_cache.len() < inventory.len() {
|
||||
state.update(|s| {
|
||||
|
Loading…
Reference in New Issue
Block a user