From eae85ce5197f864d9df47c93c00b3a200825903c Mon Sep 17 00:00:00 2001 From: IntegratedQuantum Date: Sat, 11 Jan 2025 20:59:46 +0100 Subject: [PATCH] Fix mistake in the caching of the ItemSlot amount string. fixes #913 and should make rendering a bit faster. --- src/gui/components/ItemSlot.zig | 1 + 1 file changed, 1 insertion(+) diff --git a/src/gui/components/ItemSlot.zig b/src/gui/components/ItemSlot.zig index 3f169664..2eae836e 100644 --- a/src/gui/components/ItemSlot.zig +++ b/src/gui/components/ItemSlot.zig @@ -91,6 +91,7 @@ pub fn deinit(self: *const ItemSlot) void { fn refreshText(self: *ItemSlot) void { const amount = self.inventory.getAmount(self.itemSlot); if(self.lastItemAmount == amount) return; + self.lastItemAmount = amount; self.text.deinit(); var buf: [16]u8 = undefined; self.text = TextBuffer.init(