Implement maxsize parameter for all relevant Doll subclasses
This commit is contained in:
parent
1183676c2b
commit
a219f9784f
@ -36,12 +36,12 @@ init python:
|
||||
return layers
|
||||
|
||||
@functools.cache
|
||||
def build_image(self, hash, matrix=None):
|
||||
def build_image(self, hash, matrix=None, maxsize=(1010, 1200)):
|
||||
if matrix is None:
|
||||
matrix = self.matrix
|
||||
|
||||
processors = {
|
||||
"default": lambda file: Transform(Image(file), matrixcolor=matrix),
|
||||
"default": lambda file: Transform(file, matrixcolor=matrix, maxsize=maxsize),
|
||||
}
|
||||
|
||||
layers = self.get_layers(hash)
|
||||
|
@ -113,13 +113,13 @@ init python:
|
||||
return layers
|
||||
|
||||
@functools.cache
|
||||
def build_image(self, hash, subpath="", matrix=None):
|
||||
def build_image(self, hash, subpath="", matrix=None, maxsize=(1010, 1200)):
|
||||
if matrix is None:
|
||||
matrix = self.char.body.matrix
|
||||
|
||||
processors = {
|
||||
"skin": lambda file: Transform(file, matrixcolor=matrix),
|
||||
"default": lambda file: Image(file),
|
||||
"skin": lambda file: Transform(file, matrixcolor=matrix, maxsize=maxsize),
|
||||
"default": lambda file: Transform(file, maxsize=maxsize),
|
||||
}
|
||||
|
||||
layers = self.get_layers(hash, subpath)
|
||||
|
@ -75,7 +75,7 @@ init python:
|
||||
return layers
|
||||
|
||||
@functools.cache
|
||||
def build_image(self, hash, subpath="", matrix=None):
|
||||
def build_image(self, hash, subpath="", matrix=None, maxsize=(1010, 1200)):
|
||||
layers = self.get_layers(hash, subpath)
|
||||
eyemask = next((layers.pop(k, None) for k in layers if "eyemask" in k), [None])[0]
|
||||
|
||||
@ -83,9 +83,9 @@ init python:
|
||||
matrix = self.char.body.matrix
|
||||
|
||||
processors = {
|
||||
"skin": lambda file: Transform(file, matrixcolor=matrix),
|
||||
"pupils": lambda file: AlphaMask(file, eyemask),
|
||||
"default": lambda file: Image(file),
|
||||
"skin": lambda file: Transform(file, maxsize=maxsize, matrixcolor=matrix),
|
||||
"pupils": lambda file: Transform(AlphaMask(file, eyemask), maxsize=maxsize),
|
||||
"default": lambda file: Transform(file, maxsize=maxsize),
|
||||
}
|
||||
|
||||
sprites = []
|
||||
|
Loading…
Reference in New Issue
Block a user