Fix mistake in the caching of the ItemSlot amount string.

fixes #913 and should make rendering a bit faster.
This commit is contained in:
IntegratedQuantum 2025-01-11 20:59:46 +01:00
parent a2d8ce5fb5
commit eae85ce519

View File

@ -91,6 +91,7 @@ pub fn deinit(self: *const ItemSlot) void {
fn refreshText(self: *ItemSlot) void { fn refreshText(self: *ItemSlot) void {
const amount = self.inventory.getAmount(self.itemSlot); const amount = self.inventory.getAmount(self.itemSlot);
if(self.lastItemAmount == amount) return; if(self.lastItemAmount == amount) return;
self.lastItemAmount = amount;
self.text.deinit(); self.text.deinit();
var buf: [16]u8 = undefined; var buf: [16]u8 = undefined;
self.text = TextBuffer.init( self.text = TextBuffer.init(