ui: fix BIG ui with scale (#37690)

* Update application.py

* Apply suggestions from code review

---------

Co-authored-by: Shane Smiskol <shane@smiskol.com>
This commit is contained in:
royjr
2026-03-23 04:00:28 -04:00
committed by GitHub
parent 54db569c2c
commit 1d48cbdffa

View File

@@ -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]