From d0c890a63fd2ead6810b56ed6d020a033bd4a150 Mon Sep 17 00:00:00 2001 From: OverloadedOrama <35376950+OverloadedOrama@users.noreply.github.com> Date: Tue, 24 Dec 2019 17:52:58 +0200 Subject: [PATCH] Fixed bug in outlines where some pixels might be outside the image boundaries --- Scripts/Main.gd | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Scripts/Main.gd b/Scripts/Main.gd index ea3ac70d2..95c61cf72 100644 --- a/Scripts/Main.gd +++ b/Scripts/Main.gd @@ -672,7 +672,7 @@ func _on_OutlineDialog_confirmed() -> void: for i in range(1, thickness + 1): var new_pos : Vector2 = pos + Vector2.LEFT * i - if new_pos.x > 0: + if new_pos.x >= 0: var new_pixel = image.get_pixelv(new_pos) if new_pixel.a == 0: new_image.set_pixelv(new_pos, outline_color) @@ -684,13 +684,13 @@ func _on_OutlineDialog_confirmed() -> void: new_image.set_pixelv(new_pos, outline_color) new_pos = pos + Vector2.UP * i - if yy > 0: + if new_pos.y >= 0: var new_pixel = image.get_pixelv(new_pos) if new_pixel.a == 0: new_image.set_pixelv(new_pos, outline_color) new_pos = pos + Vector2.DOWN * i - if yy < Global.canvas.size.y - 1: + if new_pos.y < Global.canvas.size.y - 1: var new_pixel = image.get_pixelv(new_pos) if new_pixel.a == 0: new_image.set_pixelv(new_pos, outline_color)