mirror of
https://github.com/godotengine/godot.git
synced 2025-02-23 23:15:07 +08:00
GradientEdit: Fix index crashes
This commit is contained in:
parent
7a0228fbba
commit
268fe9dda5
@ -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 New Issue
Block a user