From de5db85345325397a1888b399080ecceb5ae8f96 Mon Sep 17 00:00:00 2001 From: Emmanouil Papadeas Date: Thu, 25 Jan 2024 00:59:53 +0200 Subject: [PATCH] When resizing a selection with gizmos or from the tool options, only set the original_bitmap when we're not already transforming content --- src/Tools/BaseSelectionTool.gd | 5 +++-- src/UI/Canvas/Selection.gd | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/Tools/BaseSelectionTool.gd b/src/Tools/BaseSelectionTool.gd index e74ea8cdd..4374ca148 100644 --- a/src/Tools/BaseSelectionTool.gd +++ b/src/Tools/BaseSelectionTool.gd @@ -252,7 +252,8 @@ func _on_Size_value_changed(value: Vector2i) -> void: if timer.is_stopped(): undo_data = selection_node.get_undo_data(false) - selection_node.original_bitmap.copy_from(Global.current_project.selection_map) + if not selection_node.is_moving_content: + selection_node.original_bitmap.copy_from(Global.current_project.selection_map) timer.start() selection_node.big_bounding_rectangle.size = value selection_node.resize_selection() @@ -263,5 +264,5 @@ func _on_Size_ratio_toggled(button_pressed: bool) -> void: func _on_Timer_timeout() -> void: - if !selection_node.is_moving_content: + if not selection_node.is_moving_content: selection_node.commit_undo("Move Selection", undo_data) diff --git a/src/UI/Canvas/Selection.gd b/src/UI/Canvas/Selection.gd index eb1fe17f0..19a7f638d 100644 --- a/src/UI/Canvas/Selection.gd +++ b/src/UI/Canvas/Selection.gd @@ -119,10 +119,10 @@ func _input(event: InputEvent) -> void: Global.can_draw = false mouse_pos_on_gizmo_drag = image_current_pixel dragged_gizmo = gizmo_hover - original_bitmap.copy_from(Global.current_project.selection_map) if Input.is_action_pressed("transform_move_selection_only"): transform_content_confirm() if not is_moving_content: + original_bitmap.copy_from(Global.current_project.selection_map) if Input.is_action_pressed("transform_move_selection_only"): undo_data = get_undo_data(false) temp_rect = big_bounding_rectangle