diff options
Diffstat (limited to 'scene/gui/gradient_edit.cpp')
-rw-r--r-- | scene/gui/gradient_edit.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/scene/gui/gradient_edit.cpp b/scene/gui/gradient_edit.cpp index 09ef6f26bf..46c59f42fc 100644 --- a/scene/gui/gradient_edit.cpp +++ b/scene/gui/gradient_edit.cpp @@ -5,8 +5,8 @@ /* GODOT ENGINE */ /* https://godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2019 Juan Linietsky, Ariel Manzur. */ -/* Copyright (c) 2014-2019 Godot Engine contributors (cf. AUTHORS.md) */ +/* Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md). */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -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(); |