1
0
Fork 0
mirror of https://github.com/Orama-Interactive/Pixelorama.git synced 2025-02-12 16:53:07 +00:00

Update SelectionMap.gd

This commit is contained in:
NIyue 2024-11-21 21:57:06 +08:00 committed by GitHub
parent ccf4d6ffd2
commit 6c37c68acf
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -188,8 +188,16 @@ func resize_bitmap_values(
for i in ellipse_select.size() / 2:
i *= 2
var y := ellipse_select[i].y
var xmin := ellipse_select[i].x if ellipse_select[i].x < ellipse_select[i+1].x else ellipse_select[i+1].x
var xmax := ellipse_select[i].x if ellipse_select[i].x >= ellipse_select[i+1].x else ellipse_select[i+1].x
var xmin := (
ellipse_select[i].x
if ellipse_select[i].x < ellipse_select[i + 1].x
else ellipse_select[i + 1].x
)
var xmax := (
ellipse_select[i].x
if ellipse_select[i].x >= ellipse_select[i + 1].x
else ellipse_select[i + 1].x
)
if x_min[y] == null && x_max[y] == null:
x_min[y] = xmin
@ -219,7 +227,9 @@ func resize_bitmap_values(
smaller_image.resize(new_size.x, new_size.y, Image.INTERPOLATE_BILINEAR)
else:
var resized_img := Image.create(new_size.x, new_size.y, false, smaller_image.get_format())
var new_ellipse_select := DrawingAlgos.get_ellipse_points_filled(Vector2.ZERO, Vector2i(new_size.x,new_size.y))
var new_ellipse_select := DrawingAlgos.get_ellipse_points_filled(
Vector2.ZERO, Vector2i(new_size.x, new_size.y)
)
for p in new_ellipse_select:
resized_img.set_pixel(p.x, p.y, Color(1, 1, 1, 1))
smaller_image = resized_img