1
0
Fork 0
mirror of https://github.com/Orama-Interactive/Pixelorama.git synced 2025-03-12 22:35:18 +00:00

New alpha blend behavior now works on circle brushes

This commit is contained in:
OverloadedOrama 2020-02-10 02:39:36 +02:00
parent a6d129526c
commit 5fe4b74a39
2 changed files with 2 additions and 2 deletions

View file

@ -869,10 +869,11 @@ func plot_circle(sprite : Image, xm : int, ym : int, r : int, color : Color, fil
draw_pixel_blended(sprite, draw_pos, color)
func draw_pixel_blended(sprite : Image, pos : Vector2, color : Color) -> void:
if point_in_rectangle(pos, Vector2(west_limit - 1, north_limit - 1), Vector2(east_limit, south_limit)):
if point_in_rectangle(pos, Vector2(west_limit - 1, north_limit - 1), Vector2(east_limit, south_limit)) && !(pos in mouse_press_pixels):
if color.a > 0 && color.a < 1:
# Blend alpha
color.a = color.a + sprite.get_pixelv(pos).a * (1 - color.a)
mouse_press_pixels.append(pos)
sprite.set_pixelv(pos, color)
# Checks if a point is inside a rectangle

View file

@ -191,4 +191,3 @@ func get_palette_files(path : String) -> Array:
func save_palette(palette_name : String, filename : String) -> void:
var palette = Global.palettes[palette_name]
palette.save_to_file(palettes_path.plus_file(filename))