Skip to content

Commit

Permalink
Removed not needed conditions in ColorPicker
Browse files Browse the repository at this point in the history
  • Loading branch information
FeniXb3 committed Dec 11, 2024
1 parent afa959a commit 82e3faf
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions scene/gui/color_picker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1670,7 +1670,7 @@ void ColorPicker::update_uv_cursor(Vector2 &color_change_vector, bool is_echo) {
Vector2 center = wheel_uv->get_size() / 2.0;

// HACK: It's a hack, as it messes up if I calculate it this way always.
if (hsv_keyboard_picker_cursor_position == Vector2i() || Math::is_equal_approx(s, 1)) {
if (hsv_keyboard_picker_cursor_position == Vector2i()) {
hsv_keyboard_picker_cursor_position.x = center.x + (center.x * Math::cos((actual_shape == SHAPE_OKHSL_CIRCLE ? ok_hsl_h : h) * Math_TAU) * s);
hsv_keyboard_picker_cursor_position.y = center.y + (center.y * Math::sin((actual_shape == SHAPE_OKHSL_CIRCLE ? ok_hsl_h : h) * Math_TAU) * s);
}
Expand All @@ -1691,10 +1691,6 @@ void ColorPicker::update_uv_cursor(Vector2 &color_change_vector, bool is_echo) {

ok_hsl_h = h;
ok_hsl_s = s;

if (Math::is_equal_approx(s, 1)) {
hsv_keyboard_picker_cursor_position = Vector2i();
}
} else if (actual_shape == SHAPE_HSV_WHEEL) {
if (wheel_uv->has_focus()) {
s = CLAMP(s + color_change_vector.x / 100.0, 0, 1);
Expand Down

0 comments on commit 82e3faf

Please sign in to comment.