You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-17 14:11:06 +00:00
Fix color selected with mouse scroll
Fix #7192
(cherry picked from commit d9048309e4)
This commit is contained in:
@@ -296,7 +296,7 @@ void ColorPicker::_hsv_draw(int p_wich,Control* c)
|
|||||||
void ColorPicker::_uv_input(const InputEvent &ev) {
|
void ColorPicker::_uv_input(const InputEvent &ev) {
|
||||||
if (ev.type == InputEvent::MOUSE_BUTTON) {
|
if (ev.type == InputEvent::MOUSE_BUTTON) {
|
||||||
const InputEventMouseButton &bev = ev.mouse_button;
|
const InputEventMouseButton &bev = ev.mouse_button;
|
||||||
if (bev.pressed) {
|
if (bev.pressed && bev.button_index==BUTTON_LEFT) {
|
||||||
changing_color = true;
|
changing_color = true;
|
||||||
float x = CLAMP((float)bev.x,0,256);
|
float x = CLAMP((float)bev.x,0,256);
|
||||||
float y = CLAMP((float)bev.y,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) {
|
void ColorPicker::_w_input(const InputEvent &ev) {
|
||||||
if (ev.type == InputEvent::MOUSE_BUTTON) {
|
if (ev.type == InputEvent::MOUSE_BUTTON) {
|
||||||
const InputEventMouseButton &bev = ev.mouse_button;
|
const InputEventMouseButton &bev = ev.mouse_button;
|
||||||
if (bev.pressed) {
|
if (bev.pressed && bev.button_index==BUTTON_LEFT) {
|
||||||
changing_color = true;
|
changing_color = true;
|
||||||
h=1-((float)bev.y)/256.0;
|
h=1-((float)bev.y)/256.0;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user