summaryrefslogtreecommitdiff
path: root/scene
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2019-11-20 11:24:10 +0100
committerGitHub <noreply@github.com>2019-11-20 11:24:10 +0100
commit60711e67386d8300878a46f3c37260db4f2b2c84 (patch)
treebb766f1e2b8c6b0b6d34127df9e234d3e3bd8eb0 /scene
parentbd94c946516d426d5041b01e94403fa24f14b3fd (diff)
parent268fe9dda594ee8a167ef3f51ae5bec5ebb2a5a2 (diff)
Merge pull request #33750 from lupoDharkael/gradient
GradientEdit: Fix index crashes
Diffstat (limited to 'scene')
-rw-r--r--scene/gui/gradient_edit.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/scene/gui/gradient_edit.cpp b/scene/gui/gradient_edit.cpp
index 09ef6f26bf..5958106419 100644
--- a/scene/gui/gradient_edit.cpp
+++ b/scene/gui/gradient_edit.cpp
@@ -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();