1
0
Fork 0
mirror of https://github.com/Orama-Interactive/Pixelorama.git synced 2025-01-18 17:19:50 +00:00

Canvas update() is called when undoing and redoing

Also changed "Black & White" to "Desaturation"
This commit is contained in:
OverloadedOrama 2019-12-28 00:57:28 +02:00
parent cefdbc5b47
commit 5ea4835bb2
3 changed files with 8 additions and 3 deletions

View file

@ -1558,6 +1558,7 @@ margin_right = 224.0
size_flags_horizontal = 3
[node name="BrushesPopup" type="Popup" parent="."]
editor/display_folded = true
margin_right = 226.0
margin_bottom = 144.0
rect_min_size = Vector2( 0, 144 )

View file

@ -362,6 +362,7 @@ func undo(_canvases : Array, layer_index : int = -1) -> void:
if action_name == "Scale":
c.camera_zoom()
if "Layer" in action_name:
var current_layer_index : int = _canvases[0].current_layer_index
_canvases[0].generate_layer_panels()
@ -386,6 +387,7 @@ func undo(_canvases : Array, layer_index : int = -1) -> void:
frame_container.move_child(_canvases[0].frame_button, _canvases[0].frame)
canvas_parent.move_child(_canvases[0], _canvases[0].frame)
canvas.update()
notification_label("Undo: %s" % action_name)
@ -425,6 +427,7 @@ func redo(_canvases : Array, layer_index : int = -1) -> void:
frame_container.move_child(_canvases[0].frame_button, _canvases[0].frame)
canvas_parent.move_child(_canvases[0], _canvases[0].frame)
canvas.update()
if control.redone:
notification_label("Redo: %s" % action_name)

View file

@ -75,7 +75,7 @@ func _ready() -> void:
"Flip Horizontal" : KEY_MASK_SHIFT + KEY_H,
"Flip Vertical" : KEY_MASK_SHIFT + KEY_V,
"Invert Colors" : 0,
"Black & White" : 0,
"Desaturation" : 0,
"Outline" : 0
}
var help_menu_items := {
@ -256,7 +256,6 @@ func edit_menu_id_pressed(id : int) -> void:
Global.can_draw = false
func view_menu_id_pressed(id : int) -> void:
Global.canvas.update()
match id:
0: # Tile mode
Global.tile_mode = !Global.tile_mode
@ -277,6 +276,8 @@ func view_menu_id_pressed(id : int) -> void:
if guide is Guide:
guide.visible = Global.show_guides
Global.canvas.update()
func image_menu_id_pressed(id : int) -> void:
match id:
0: # Scale Image
@ -339,7 +340,7 @@ func image_menu_id_pressed(id : int) -> void:
continue
image.set_pixel(xx, yy, px_color)
Global.canvas.handle_redo("Draw")
5: # Black & White
5: # Desaturation
var image : Image = Global.canvas.layers[Global.canvas.current_layer_index][0]
Global.canvas.handle_undo("Draw")
for xx in image.get_size().x: