Having no active selection no longer treats all the pixels of the canvas as selected

A performance boost for when opening large images. Also fixed an issue with pixels being selected outside of the canvas boundaries, when the selection rectangle was outside the canvas and its size got reduced.
This commit is contained in:
Manolis Papadeas 2021-01-31 15:09:54 +02:00
parent 7f1594e1bc
commit c54b74f829
9 changed files with 31 additions and 19 deletions

View file

@ -39,7 +39,7 @@ func set_rect(rect : Rect2) -> void:
var project : Project = Global.current_project
if rect.has_no_area():
project.select_all_pixels()
project.selected_pixels = []
else:
project.clear_selection()
for x in range(rect.position.x, rect.end.x):