@@ -16,6 +16,9 @@ var _add := false ## Shift + Mouse Click
1616var _subtract := false ## Ctrl + Mouse Click
1717var _intersect := false ## Shift + Ctrl + Mouse Click
1818
19+ ## Used to check if the state of content transformation has been changed
20+ ## while draw_move() is being called. For example, pressing Enter while still moving content
21+ var _transformation_status_changed := false
1922var _skip_slider_logic := false
2023
2124@onready var selection_node := Global .canvas .selection
@@ -28,14 +31,16 @@ var _skip_slider_logic := false
2831
2932
3033func _ready () -> void :
31- super . _ready ()
32- algorithm_option_button .add_item ("Nearest Neighbor " )
34+ super ()
35+ algorithm_option_button .add_item ("Nearest neighbor " )
3336 algorithm_option_button .add_item ("cleanEdge" , DrawingAlgos .RotationAlgorithm .CLEANEDGE )
3437 algorithm_option_button .add_item ("OmniScale" , DrawingAlgos .RotationAlgorithm .OMNISCALE )
3538 algorithm_option_button .select (0 )
3639 set_confirm_buttons_visibility ()
3740 set_spinbox_values ()
3841 refresh_options ()
42+ selection_node .transformation_confirmed .connect (func (): _transformation_status_changed = true )
43+ selection_node .transformation_canceled .connect (func (): _transformation_status_changed = true )
3944 transformation_handles .preview_transform_changed .connect (set_confirm_buttons_visibility )
4045
4146
@@ -91,7 +96,8 @@ func set_spinbox_values() -> void:
9196
9297func draw_start (pos : Vector2i ) -> void :
9398 pos = snap_position (pos )
94- super .draw_start (pos )
99+ super (pos )
100+ _transformation_status_changed = false
95101 if transformation_handles .arrow_key_move :
96102 return
97103 var project := Global .current_project
@@ -136,9 +142,11 @@ func draw_start(pos: Vector2i) -> void:
136142
137143func draw_move (pos : Vector2i ) -> void :
138144 pos = snap_position (pos )
139- super . draw_move (pos )
145+ super (pos )
140146 if transformation_handles .arrow_key_move :
141147 return
148+ if _transformation_status_changed :
149+ return
142150 if not _move :
143151 return
144152 var project := Global .current_project
@@ -173,7 +181,7 @@ func draw_move(pos: Vector2i) -> void:
173181
174182func draw_end (pos : Vector2i ) -> void :
175183 pos = snap_position (pos )
176- super . draw_end (pos )
184+ super (pos )
177185 if transformation_handles .arrow_key_move :
178186 return
179187 if not _move :
0 commit comments