Skip to content

Commit

Permalink
Merge pull request godotengine#48444 from KoBeWi/editor_bug_slider
Browse files Browse the repository at this point in the history
Fixed wrong mouse position after releasing grabber
  • Loading branch information
akien-mga authored May 4, 2021
2 parents c9e874b + dcf306f commit c26cff7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion editor/editor_spin_slider.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ void EditorSpinSlider::_gui_input(const Ref<InputEvent> &p_event) {
grabbing_spinner_dist_cache = 0;
pre_grab_value = get_value();
grabbing_spinner = false;
grabbing_spinner_mouse_pos = Input::get_singleton()->get_mouse_position();
}
} else {
if (grabbing_spinner_attempt) {
Expand Down Expand Up @@ -283,6 +282,8 @@ void EditorSpinSlider::_notification(int p_what) {
Rect2 grabber_rect = Rect2(ofs + gofs, svofs + 1, grabber_w, 2 * EDSCALE);
draw_rect(grabber_rect, c);

grabbing_spinner_mouse_pos = get_global_position() + grabber_rect.position + grabber_rect.size * 0.5;

bool display_grabber = (mouse_over_spin || mouse_over_grabber) && !grabbing_spinner && !value_input_popup->is_visible();
if (grabber->is_visible() != display_grabber) {
if (display_grabber) {
Expand Down

0 comments on commit c26cff7

Please sign in to comment.