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

Gizmos resizing no longer re-flips the image when temp_rect is negative

This commit is contained in:
Manolis Papadeas 2021-04-21 18:16:42 +03:00
parent b420bebb3e
commit 515e75f3dd

View file

@ -85,7 +85,7 @@ func _input(event : InputEvent) -> void:
if big_bounding_rectangle.size != Vector2.ZERO: if big_bounding_rectangle.size != Vector2.ZERO:
for g in gizmos: for g in gizmos:
if g.rect.has_point(Global.canvas.current_pixel): if g.rect.has_point(Global.canvas.current_pixel):
gizmo = g gizmo = Gizmo.new(g.type, g.direction)
break break
if gizmo: if gizmo:
Global.main_viewport.mouse_default_cursor_shape = gizmo.get_cursor() Global.main_viewport.mouse_default_cursor_shape = gizmo.get_cursor()
@ -98,6 +98,7 @@ func _input(event : InputEvent) -> void:
Global.has_focus = false Global.has_focus = false
mouse_pos_on_gizmo_drag = Global.canvas.current_pixel mouse_pos_on_gizmo_drag = Global.canvas.current_pixel
dragged_gizmo = gizmo dragged_gizmo = gizmo
if !is_moving_content:
temp_rect = big_bounding_rectangle temp_rect = big_bounding_rectangle
temp_bitmap = Global.current_project.selection_bitmap temp_bitmap = Global.current_project.selection_bitmap
move_content_start() move_content_start()
@ -105,6 +106,9 @@ func _input(event : InputEvent) -> void:
if gizmo.type == Gizmo.Type.ROTATE: if gizmo.type == Gizmo.Type.ROTATE:
var img_size := max(original_preview_image.get_width(), original_preview_image.get_height()) var img_size := max(original_preview_image.get_width(), original_preview_image.get_height())
original_preview_image.crop(img_size, img_size) original_preview_image.crop(img_size, img_size)
else:
dragged_gizmo.direction.x *= sign(temp_rect.size.x)
dragged_gizmo.direction.y *= sign(temp_rect.size.y)
elif dragged_gizmo: elif dragged_gizmo:
Global.has_focus = true Global.has_focus = true