From 82e7e936fc6946e197f41880fd061bd8f0053e54 Mon Sep 17 00:00:00 2001 From: Manolis Papadeas <35376950+OverloadedOrama@users.noreply.github.com> Date: Fri, 16 Apr 2021 21:47:03 +0300 Subject: [PATCH] Restored LightenDarken's previous behavior Fixes a minor issue from 6cce27a36056d32f3e625c41579308da47f19580 --- src/Tools/Draw.gd | 6 +++--- src/Tools/LightenDarken.gd | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Tools/Draw.gd b/src/Tools/Draw.gd index a5dfa22af..776fc9b08 100644 --- a/src/Tools/Draw.gd +++ b/src/Tools/Draw.gd @@ -129,8 +129,8 @@ func update_mirror_brush() -> void: _mirror_brushes.xy.flip_y() -func update_mask() -> void: - if Global.pressure_sensitivity_mode == Global.PressureSensitivity.NONE: +func update_mask(can_skip := true) -> void: + if can_skip and Global.pressure_sensitivity_mode == Global.PressureSensitivity.NONE: return var size := _get_draw_image().get_size() # Faster than zeroing PoolByteArray directly. See: https://github.com/Orama-Interactive/Pixelorama/pull/439 @@ -347,7 +347,7 @@ func _set_pixel(position : Vector2) -> void: var image := _get_draw_image() var i := int(position.x + position.y * image.get_size().x) - if Global.pressure_sensitivity_mode != Global.PressureSensitivity.NONE: + if _mask.size() >= i + 1: if _mask[i] < Tools.pen_pressure: _mask[i] = Tools.pen_pressure _drawer.set_pixel(image, position, tool_slot.color) diff --git a/src/Tools/LightenDarken.gd b/src/Tools/LightenDarken.gd index 59e4359eb..a5452eb6c 100644 --- a/src/Tools/LightenDarken.gd +++ b/src/Tools/LightenDarken.gd @@ -200,7 +200,7 @@ func update_strength() -> void: func draw_start(position : Vector2) -> void: - update_mask() + update_mask(false) _changed = false _drawer.color_op.changed = false