mirror of
https://github.com/Orama-Interactive/Pixelorama.git
synced 2025-03-13 06:45:17 +00:00
New alpha blend behavior now works on circle brushes
This commit is contained in:
parent
a6d129526c
commit
5fe4b74a39
2 changed files with 2 additions and 2 deletions
|
@ -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)
|
draw_pixel_blended(sprite, draw_pos, color)
|
||||||
|
|
||||||
func draw_pixel_blended(sprite : Image, pos : Vector2, color : Color) -> void:
|
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:
|
if color.a > 0 && color.a < 1:
|
||||||
# Blend alpha
|
# Blend alpha
|
||||||
color.a = color.a + sprite.get_pixelv(pos).a * (1 - color.a)
|
color.a = color.a + sprite.get_pixelv(pos).a * (1 - color.a)
|
||||||
|
mouse_press_pixels.append(pos)
|
||||||
sprite.set_pixelv(pos, color)
|
sprite.set_pixelv(pos, color)
|
||||||
|
|
||||||
# Checks if a point is inside a rectangle
|
# Checks if a point is inside a rectangle
|
||||||
|
|
|
@ -191,4 +191,3 @@ func get_palette_files(path : String) -> Array:
|
||||||
func save_palette(palette_name : String, filename : String) -> void:
|
func save_palette(palette_name : String, filename : String) -> void:
|
||||||
var palette = Global.palettes[palette_name]
|
var palette = Global.palettes[palette_name]
|
||||||
palette.save_to_file(palettes_path.plus_file(filename))
|
palette.save_to_file(palettes_path.plus_file(filename))
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue