mirror of
https://github.com/tonytins/CozyPixelStudio.git
synced 2025-06-25 15:54:44 -04:00
Fixed crash that occured when trying to delete contents of a selection that were outside the canvas' borders
This commit is contained in:
parent
ff3b5e321b
commit
db29c1af67
2 changed files with 4 additions and 3 deletions
|
@ -133,7 +133,8 @@ func _process(delta : float) -> void:
|
|||
Global.canvas.handle_undo("Draw")
|
||||
for xx in range(start_pos.x, end_pos.x):
|
||||
for yy in range(start_pos.y, end_pos.y):
|
||||
layer.set_pixel(xx, yy, Color(0, 0, 0, 0))
|
||||
if point_in_rectangle(Vector2(xx, yy), Global.canvas.location - Vector2.ONE, Global.canvas.location + Global.canvas.size):
|
||||
layer.set_pixel(xx, yy, Color(0, 0, 0, 0))
|
||||
Global.canvas.handle_redo("Draw")
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue