1
0
Fork 0
mirror of https://github.com/Orama-Interactive/Pixelorama.git synced 2025-01-18 17:19:50 +00:00

Fix out of bounds errors with selection intersection

This commit is contained in:
Manolis Papadeas 2021-05-03 03:09:32 +03:00
parent 3ad3697c84
commit 8f846fe04a

View file

@ -285,6 +285,8 @@ func select_rect(rect : Rect2, operation : int = SelectionOperation.ADD) -> void
for x in range(rect.position.x, rect.end.x):
for y in range(rect.position.y, rect.end.y):
var pos := Vector2(x, y)
if !Rect2(Vector2.ZERO, selection_bitmap_copy.get_size()).has_point(pos):
continue
selection_bitmap_copy.set_bit(pos, project.selection_bitmap.get_bit(pos))
big_bounding_rectangle = project.get_selection_rectangle(selection_bitmap_copy)