diff options
| author | volzhs | 2016-11-27 23:11:42 +0900 |
|---|---|---|
| committer | Rémi Verschelde | 2017-01-12 19:15:26 +0100 |
| commit | f95694ee8674c69c51af3352188fbbb4fb8dc3cc (patch) | |
| tree | 20c74dc15750d80c53dc0e593e617559027e76f6 | |
| parent | 6227e8f343528202da7a09835e1e3dcc60e3e27c (diff) | |
| download | godot-f95694ee8674c69c51af3352188fbbb4fb8dc3cc.tar.gz godot-f95694ee8674c69c51af3352188fbbb4fb8dc3cc.tar.zst godot-f95694ee8674c69c51af3352188fbbb4fb8dc3cc.zip | |
Fix color selected with mouse scroll
Fix #7192
(cherry picked from commit d9048309e4df65d4b4d0bf87265ce67a2234389c)
| -rw-r--r-- | scene/gui/color_picker.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/scene/gui/color_picker.cpp b/scene/gui/color_picker.cpp index b69646432..cf32abf11 100644 --- a/scene/gui/color_picker.cpp +++ b/scene/gui/color_picker.cpp @@ -296,7 +296,7 @@ void ColorPicker::_hsv_draw(int p_wich,Control* c) void ColorPicker::_uv_input(const InputEvent &ev) { if (ev.type == InputEvent::MOUSE_BUTTON) { const InputEventMouseButton &bev = ev.mouse_button; - if (bev.pressed) { + if (bev.pressed && bev.button_index==BUTTON_LEFT) { changing_color = true; float x = CLAMP((float)bev.x,0,256); float y = CLAMP((float)bev.y,0,256); @@ -329,7 +329,7 @@ void ColorPicker::_uv_input(const InputEvent &ev) { void ColorPicker::_w_input(const InputEvent &ev) { if (ev.type == InputEvent::MOUSE_BUTTON) { const InputEventMouseButton &bev = ev.mouse_button; - if (bev.pressed) { + if (bev.pressed && bev.button_index==BUTTON_LEFT) { changing_color = true; h=1-((float)bev.y)/256.0; |
