mirror of
https://github.com/Orama-Interactive/Pixelorama.git
synced 2025-01-18 17:19:50 +00:00
Fix not being able to transform if the selection size is bigger than the project size
This commit is contained in:
parent
5277895f7f
commit
f10c89ace5
|
@ -908,8 +908,12 @@ func _get_preview_image() -> void:
|
|||
original_preview_image.create(
|
||||
big_bounding_rectangle.size.x, big_bounding_rectangle.size.y, false, Image.FORMAT_RGBA8
|
||||
)
|
||||
var selection_map_copy := SelectionMap.new()
|
||||
selection_map_copy.copy_from(project.selection_map)
|
||||
# In case the selection map is bigger than the canvas
|
||||
selection_map_copy.crop(project.size.x, project.size.y)
|
||||
original_preview_image.blit_rect_mask(
|
||||
blended_image, project.selection_map, big_bounding_rectangle, Vector2.ZERO
|
||||
blended_image, selection_map_copy, big_bounding_rectangle, Vector2.ZERO
|
||||
)
|
||||
if original_preview_image.is_invisible():
|
||||
original_preview_image = Image.new()
|
||||
|
@ -944,5 +948,9 @@ func _get_selected_image(cel_image: Image) -> Image:
|
|||
image.create(
|
||||
big_bounding_rectangle.size.x, big_bounding_rectangle.size.y, false, Image.FORMAT_RGBA8
|
||||
)
|
||||
image.blit_rect_mask(cel_image, project.selection_map, big_bounding_rectangle, Vector2.ZERO)
|
||||
var selection_map_copy := SelectionMap.new()
|
||||
selection_map_copy.copy_from(project.selection_map)
|
||||
# In case the selection map is bigger than the canvas
|
||||
selection_map_copy.crop(project.size.x, project.size.y)
|
||||
image.blit_rect_mask(cel_image, selection_map_copy, big_bounding_rectangle, Vector2.ZERO)
|
||||
return image
|
||||
|
|
Loading…
Reference in a new issue