diff --git a/system/ui/lib/application.py b/system/ui/lib/application.py index 470396bbc7..319123eb19 100644 --- a/system/ui/lib/application.py +++ b/system/ui/lib/application.py @@ -50,9 +50,10 @@ class GuiApplication: self._set_styles() self._load_fonts() - def load_texture_from_image(self, file_name: str, width: int, height: int): + def load_texture_from_image(self, file_name: str, width: int, height: int, alpha_premultiply = False): """Load and resize a texture, storing it for later automatic unloading.""" image = rl.load_image(file_name) + if alpha_premultiply: rl.image_alpha_premultiply(image) rl.image_resize(image, width, height) texture = rl.load_texture_from_image(image) # Set texture filtering to smooth the result diff --git a/system/ui/spinner.py b/system/ui/spinner.py index adfb604de9..f3724cbd1e 100755 --- a/system/ui/spinner.py +++ b/system/ui/spinner.py @@ -23,7 +23,8 @@ def clamp(value, min_value, max_value): class Spinner: def __init__(self): self._comma_texture = gui_app.load_texture_from_image(os.path.join(BASEDIR, "selfdrive/assets/img_spinner_comma.png"), TEXTURE_SIZE, TEXTURE_SIZE) - self._spinner_texture = gui_app.load_texture_from_image(os.path.join(BASEDIR, "selfdrive/assets/img_spinner_track.png"), TEXTURE_SIZE, TEXTURE_SIZE) + self._spinner_texture = gui_app.load_texture_from_image(os.path.join(BASEDIR, "selfdrive/assets/img_spinner_track.png"), TEXTURE_SIZE, TEXTURE_SIZE, + alpha_premultiply=True) self._rotation = 0.0 self._text: str = "" self._progress: int | None = None