From 5562d3f2d5bcdf11a4c2cc31e876b9c63d3a4857 Mon Sep 17 00:00:00 2001 From: OverloadedOrama <35376950+OverloadedOrama@users.noreply.github.com> Date: Sun, 12 Jan 2020 02:34:47 +0200 Subject: [PATCH] LightenDarken tool no longer affects transparent pixels --- Changelog.md | 2 ++ Scripts/Canvas.gd | 10 ++++++---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/Changelog.md b/Changelog.md index 1c3854cfa..d7bca09d1 100644 --- a/Changelog.md +++ b/Changelog.md @@ -13,6 +13,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ### Changed - When saving a .pxo file, the file path (along with the file name) gets remembered by the Export PNG file dialog path. (Issue #114) +- LightenDarken tool no longer affects transparent pixels. - More translatable strings, updates to Greek & Brazilian Portuguese (thanks to YeldhamDev) translations. - The dark theme button is now pressed by default if the user hasn't saved a theme preference in the config file. - Added a VSplitContainer for the tools and their options, and another one for Palettes and Layers. @@ -26,6 +27,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - Fixed .gpl palettes not being imported correctly - Issue #112 - Fixed crash that occured when pressing the play buttons on the timeline, on Godot 3.2 - Issue #111 - Fixed bug where, if you had a random brush selected and then selected the pencil tool, "brush color from" did not appear. +- Fixed crash on Godot 3.2.beta6 when pressing the Edit Palette button. ## [v0.6] - 06-01-2020 diff --git a/Scripts/Canvas.gd b/Scripts/Canvas.gd index ac6eca65a..1e54f3f1f 100644 --- a/Scripts/Canvas.gd +++ b/Scripts/Canvas.gd @@ -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)