mirror of
https://github.com/tonytins/CozyPixelStudio.git
synced 2025-06-25 22:44:42 -04:00
Merge mirrored drawing and flip
This commit is contained in:
parent
38377e1633
commit
2b64031786
2 changed files with 18 additions and 2 deletions
|
@ -33,7 +33,9 @@ func _ready() -> void:
|
|||
var edit_menu_items := {
|
||||
"Scale Image" : 0,
|
||||
"Crop Image" : 0,
|
||||
"Clear Selection" : 0
|
||||
"Clear Selection" : 0,
|
||||
"Flip Horizontal": KEY_MASK_SHIFT + KEY_H,
|
||||
"Flip Vertical": KEY_MASK_SHIFT + KEY_V
|
||||
#"Undo" : KEY_MASK_CTRL + KEY_Z,
|
||||
#"Redo" : KEY_MASK_SHIFT + KEY_MASK_CTRL + KEY_Z,
|
||||
}
|
||||
|
@ -182,6 +184,18 @@ func edit_menu_id_pressed(id : int) -> void:
|
|||
Global.selection_rectangle.polygon[2] = Vector2.ZERO
|
||||
Global.selection_rectangle.polygon[3] = Vector2.ZERO
|
||||
Global.selected_pixels.clear()
|
||||
3: # Flip Horizontal
|
||||
var canvas = Global.canvas
|
||||
canvas.layers[canvas.current_layer_index][0].unlock()
|
||||
canvas.layers[canvas.current_layer_index][0].flip_x()
|
||||
canvas.layers[canvas.current_layer_index][0].lock()
|
||||
canvas.update_texture(canvas.current_layer_index)
|
||||
4: # Flip Vertical
|
||||
var canvas = Global.canvas
|
||||
canvas.layers[canvas.current_layer_index][0].unlock()
|
||||
canvas.layers[canvas.current_layer_index][0].flip_y()
|
||||
canvas.layers[canvas.current_layer_index][0].lock()
|
||||
canvas.update_texture(canvas.current_layer_index)
|
||||
|
||||
func view_menu_id_pressed(id : int) -> void:
|
||||
match id:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue