mirror of
https://github.com/Orama-Interactive/Pixelorama.git
synced 2025-02-21 13:03:13 +00:00
Resize selection without contents if Alt is pressed before clicking on a gizmo
This commit is contained in:
parent
3876c97674
commit
9b54f8a387
1 changed files with 17 additions and 8 deletions
|
@ -110,6 +110,9 @@ func _input(event : InputEvent) -> void:
|
|||
temp_bitmap = Global.current_project.selection_bitmap
|
||||
if !is_moving_content:
|
||||
temp_rect = big_bounding_rectangle
|
||||
if Input.is_action_pressed("alt"):
|
||||
undo_data = _get_undo_data(false)
|
||||
else:
|
||||
transform_content_start()
|
||||
Global.current_project.selection_offset = Vector2.ZERO
|
||||
if gizmo.type == Gizmo.Type.ROTATE:
|
||||
|
@ -136,6 +139,8 @@ func _input(event : InputEvent) -> void:
|
|||
elif dragged_gizmo:
|
||||
Global.has_focus = true
|
||||
dragged_gizmo = null
|
||||
if !is_moving_content:
|
||||
commit_undo("Rectangle Select", undo_data)
|
||||
|
||||
if dragged_gizmo:
|
||||
if dragged_gizmo.type == Gizmo.Type.SCALE:
|
||||
|
@ -314,6 +319,7 @@ func gizmo_resize() -> void:
|
|||
self.big_bounding_rectangle = big_bounding_rectangle # Call the setter method
|
||||
|
||||
var size = big_bounding_rectangle.size.abs()
|
||||
if is_moving_content:
|
||||
preview_image.copy_from(original_preview_image)
|
||||
preview_image.resize(size.x, size.y, Image.INTERPOLATE_NEAREST)
|
||||
if temp_rect.size.x < 0:
|
||||
|
@ -475,6 +481,9 @@ func transform_content_cancel() -> void:
|
|||
|
||||
|
||||
func commit_undo(action : String, _undo_data : Dictionary) -> void:
|
||||
if !_undo_data:
|
||||
print("No undo data found!")
|
||||
return
|
||||
var redo_data = _get_undo_data("image_data" in _undo_data)
|
||||
var project := Global.current_project
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue