LightenDarken tool no longer affects transparent pixels

This commit is contained in:
OverloadedOrama 2020-01-12 02:34:47 +02:00
parent 340a885cd7
commit 5562d3f2d5
2 changed files with 8 additions and 4 deletions

View file

@ -611,10 +611,12 @@ func draw_pixel(pos : Vector2, color : Color, current_mouse_button : String, cur
var current_pixel_color : Color = layers[current_layer_index][0].get_pixel(cur_pos_x, cur_pos_y)
if current_pixel_color != color && !(pos_floored in lighten_darken_pixels):
if current_action == "LightenDarken":
if ld == 0: # Lighten
color = current_pixel_color.lightened(ld_amount)
else:
color = current_pixel_color.darkened(ld_amount)
color = current_pixel_color
if color.a > 0:
if ld == 0: # Lighten
color = current_pixel_color.lightened(ld_amount)
else: # Darken
color = current_pixel_color.darkened(ld_amount)
lighten_darken_pixels.append(pos_floored)
layers[current_layer_index][0].set_pixel(cur_pos_x, cur_pos_y, color)