mirror of
https://github.com/Orama-Interactive/Pixelorama.git
synced 2025-02-20 12:33:14 +00:00
Merge mirrored drawing and flip
This commit is contained in:
parent
38377e1633
commit
2b64031786
2 changed files with 18 additions and 2 deletions
|
@ -211,6 +211,7 @@ func _process(delta) -> void:
|
|||
|
||||
if sprite_changed_this_frame:
|
||||
update_texture(current_layer_index)
|
||||
|
||||
|
||||
func update_texture(layer_index : int) -> void:
|
||||
layers[layer_index][1].create_from_image(layers[layer_index][0], 0)
|
||||
|
@ -564,4 +565,5 @@ func rectangle_center(pos : Vector2, size : Vector2) -> Vector2:
|
|||
return (pos - size / 2).floor()
|
||||
|
||||
func _on_Timer_timeout() -> void:
|
||||
Global.can_draw = true
|
||||
Global.can_draw = true
|
||||
|
|
@ -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
Reference in a new issue