GradientEdit: Fix index crashes
This commit is contained in:
parent
7a0228fbba
commit
268fe9dda5
1 changed files with 3 additions and 2 deletions
|
@ -277,12 +277,13 @@ void GradientEdit::_gui_input(const Ref<InputEvent> &p_event) {
|
|||
|
||||
if (points[i].offset == newofs && i != grabbed) {
|
||||
valid = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!valid)
|
||||
if (!valid || grabbed == -1) {
|
||||
return;
|
||||
|
||||
}
|
||||
points.write[grabbed].offset = newofs;
|
||||
|
||||
points.sort();
|
||||
|
|
Loading…
Reference in a new issue