From 1963d99e452159eef3aff5059ab98542b0cbec4c Mon Sep 17 00:00:00 2001 From: OverloadedOrama <35376950+OverloadedOrama@users.noreply.github.com> Date: Fri, 3 Apr 2020 16:13:49 +0300 Subject: [PATCH] Fixed issue where custom brushes were sometimes not being drawn --- Scripts/Canvas.gd | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Scripts/Canvas.gd b/Scripts/Canvas.gd index 161a76554..afafc78af 100644 --- a/Scripts/Canvas.gd +++ b/Scripts/Canvas.gd @@ -993,8 +993,10 @@ func blend_rect(bg : Image, brush : Image, src_rect : Rect2, dst : Vector2) -> v var dst_x := dest_rect.position.x + x; var dst_y := dest_rect.position.y + y; + brush.lock() var brush_color := brush.get_pixel(src_x, src_y) var bg_color := bg.get_pixel(dst_x, dst_y) var out_color := blend_colors(brush_color, bg_color) if out_color.a != 0: bg.set_pixel(dst_x, dst_y, out_color) + brush.unlock()