From 0280b08815545e5bc906ad6f67d6cb6ede6701b5 Mon Sep 17 00:00:00 2001 From: Huevos Date: Sat, 21 Sep 2024 18:19:59 +0200 Subject: [PATCH] [skin] force scaling of graphics if "screen.resolution" attribute is set --- lib/python/skin.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/python/skin.py b/lib/python/skin.py index d2bc793099..fc72bcd308 100644 --- a/lib/python/skin.py +++ b/lib/python/skin.py @@ -482,7 +482,12 @@ def applyOne(self, attrib, value): print("[Skin] Attribute '%s' with wrong (or unknown) value '%s' in object of type '%s'!" % (attrib, value, self.guiObject.__class__.__name__)) def applyAll(self, attrs): - attrs.sort(key=lambda a: {"pixmap": 1}.get(a[0], 0)) # For svg pixmap scale required the size, so sort pixmap last + attrs.sort(key=lambda a: {"pixmap": 1, "scale": -1}.get(a[0], 0)) # For svg pixmap scale required the size, so sort pixmap last (and scale first) + + # if skin attribute "screen.resolution" is set, graphics should be scaled, so force that here + if attrs and attrs[-1][0] == "pixmap" and (self.scaleTuple[0][0] != self.scaleTuple[0][1] or self.scaleTuple[1][0] != self.scaleTuple[1][1]) and attrs[0][0] != "scale": + attrs.insert(0, ("scale", "1")) + for attrib, value in attrs: self.applyOne(attrib, value)