1
0
Fork 0
mirror of https://github.com/Orama-Interactive/Pixelorama.git synced 2025-01-31 07:29:49 +00:00

Fix frame and layer clamping in ExtensionsAPI's get_cel_at()

This commit is contained in:
Emmanouil Papadeas 2023-11-20 15:05:35 +02:00
parent e14a506d2c
commit f70f3d3458

View file

@ -430,8 +430,8 @@ class ProjectAPI:
func get_cel_at(project: Project, frame: int, layer: int) -> BaseCel: func get_cel_at(project: Project, frame: int, layer: int) -> BaseCel:
# frames from left to right, layers from bottom to top # frames from left to right, layers from bottom to top
clamp(frame, 0, project.frames.size() - 1) frame = clamp(frame, 0, project.frames.size() - 1)
clamp(layer, 0, project.layers.size() - 1) layer = clamp(layer, 0, project.layers.size() - 1)
return project.frames[frame].cels[layer] return project.frames[frame].cels[layer]
func set_pixelcel_image(image: Image, frame: int, layer: int) -> void: func set_pixelcel_image(image: Image, frame: int, layer: int) -> void: