Added affecting options to the HSVDialog

First option is to affect the selected pixels only. The second it to affect the current cel, or the entire frame (all cels of the frame). Options to affect all frames and all projects will be added next. I also made changes to Canvas.handle_undo() and handle_redo() to make this work.

Once all these options are added successfully in HSVDialog, they will also be added in the rest of the Image effect dialogs.
This commit is contained in:
OverloadedOrama 2020-07-24 03:22:12 +03:00
parent 5612064533
commit 1ce89c6577
4 changed files with 120 additions and 41 deletions

View file

@ -454,9 +454,9 @@ func generate_outline(image : Image, outline_color : Color, thickness : int, dia
Global.canvas.handle_redo("Draw")
func adjust_hsv(img: Image, delta_h : float, delta_s : float, delta_v : float) -> void:
func adjust_hsv(img: Image, delta_h : float, delta_s : float, delta_v : float, pixels : Array) -> void:
img.lock()
for i in Global.current_project.selected_pixels:
for i in pixels:
var c : Color = img.get_pixelv(i)
# Hue
var hue = range_lerp(c.h,0,1,-180,180)