Skip to content

Commit

Permalink
[skin] force scaling of graphics if "screen.resolution" attribute is set
Browse files Browse the repository at this point in the history
  • Loading branch information
Huevos committed Sep 21, 2024
1 parent ab737c9 commit 0280b08
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/python/skin.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down

0 comments on commit 0280b08

Please sign in to comment.