diff --git a/system/ui/lib/application.py b/system/ui/lib/application.py index 1d518309d3..980410b022 100644 --- a/system/ui/lib/application.py +++ b/system/ui/lib/application.py @@ -452,6 +452,11 @@ class GuiApplication: def texture(self, asset_path: str, width: int | None = None, height: int | None = None, alpha_premultiply=False, keep_aspect_ratio=True, flip_x: bool = False) -> rl.Texture: + if width is not None: + width = round(width) + if height is not None: + height = round(height) + cache_key = f"{asset_path}_{width}_{height}_{alpha_premultiply}_{keep_aspect_ratio}_{flip_x}" if cache_key in self._textures: return self._textures[cache_key]