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

Fix issue when resizing selection after moving it

This commit is contained in:
Manolis Papadeas 2021-04-22 03:50:16 +03:00
parent 687f2619a1
commit 58ef2420c9

View file

@ -107,8 +107,20 @@ func _input(event : InputEvent) -> void:
var img_size := max(original_preview_image.get_width(), original_preview_image.get_height())
original_preview_image.crop(img_size, img_size)
else:
var prev_temp_rect := temp_rect
dragged_gizmo.direction.x *= sign(temp_rect.size.x)
dragged_gizmo.direction.y *= sign(temp_rect.size.y)
temp_rect = big_bounding_rectangle
# If prev_temp_rect, which used to be the previous temp_rect, has negative size,
# switch the position and end point in temp_rect
if prev_temp_rect.size.x < 0:
var pos = temp_rect.position.x
temp_rect.position.x = temp_rect.end.x
temp_rect.end.x = pos
if prev_temp_rect.size.y < 0:
var pos = temp_rect.position.y
temp_rect.position.y = temp_rect.end.y
temp_rect.end.y = pos
elif dragged_gizmo:
Global.has_focus = true