diff options
Diffstat (limited to 'scene/gui/gradient_edit.cpp')
-rw-r--r-- | scene/gui/gradient_edit.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/scene/gui/gradient_edit.cpp b/scene/gui/gradient_edit.cpp index dc013f00a5..c13964d196 100644 --- a/scene/gui/gradient_edit.cpp +++ b/scene/gui/gradient_edit.cpp @@ -29,8 +29,8 @@ /*************************************************************************/ #include "gradient_edit.h" +#include "core/os/keyboard.h" #include "editor/editor_scale.h" -#include "os/keyboard.h" #define SPACING (3 * EDSCALE) @@ -236,23 +236,23 @@ void GradientEdit::_gui_input(const Ref<InputEvent> &p_event) { //Snap to nearest point if holding shift if (mm->get_shift()) { - float snap_treshhold = 0.03; - float smallest_ofs = snap_treshhold; - bool founded = false; - int nearest_point; + float snap_threshold = 0.03; + float smallest_ofs = snap_threshold; + bool found = false; + int nearest_point = 0; for (int i = 0; i < points.size(); ++i) { if (i != grabbed) { float temp_ofs = ABS(points[i].offset - newofs); if (temp_ofs < smallest_ofs) { smallest_ofs = temp_ofs; nearest_point = i; - if (founded) + if (found) break; - founded = true; + found = true; } } } - if (founded) { + if (found) { if (points[nearest_point].offset < newofs) newofs = points[nearest_point].offset + 0.00001; else |