layeredimage: Only create the transform if it's needed.
This commit is contained in:
@@ -562,6 +562,7 @@ python early in layeredimage:
|
||||
"""
|
||||
|
||||
attribute_function = None
|
||||
transforms = { }
|
||||
|
||||
def __init__(self, attributes, at=[], name=None, image_format=None, format_function=None, attribute_function=None, **kwargs):
|
||||
|
||||
@@ -588,7 +589,7 @@ python early in layeredimage:
|
||||
kwargs.setdefault("xfit", True)
|
||||
kwargs.setdefault("yfit", True)
|
||||
|
||||
self.transform_args = {k : kwargs.pop(k) for k, v in kwargs.items() if k not in (renpy.sl2.slproperties.position_property_names + renpy.sl2.slproperties.box_property_names)}
|
||||
self.transform_args = { k : kwargs.pop(k) for k, v in kwargs.items() if k not in renpy.sl2.slproperties.box_property_names }
|
||||
self.fixed_args = kwargs
|
||||
|
||||
def format(self, what, attribute=None, group=None, variant=None, image=None):
|
||||
@@ -688,10 +689,12 @@ python early in layeredimage:
|
||||
|
||||
rv = Fixed(rv, text, fit_first=True)
|
||||
|
||||
|
||||
for i in self.at+[Transform(**self.transform_args)]:
|
||||
for i in self.at:
|
||||
rv = i(rv)
|
||||
|
||||
if self.transform_args:
|
||||
rv = Transform(child=rv, **self.transform_args)
|
||||
|
||||
return rv
|
||||
|
||||
def _list_attributes(self, tag, attributes):
|
||||
|
||||
Reference in New Issue
Block a user