Skip to content

Commit

Permalink
Fix EditorSpinSlider grabber doesn't follow parent when scrolling.
Browse files Browse the repository at this point in the history
(cherry picked from commit blazium-engine/blazium@a501d9f)
  • Loading branch information
WhalesState authored and Spartan322 committed Oct 23, 2024
1 parent 3a91796 commit 23ac81f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions editor/gui/editor_spin_slider.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -446,7 +446,7 @@ void EditorSpinSlider::_draw_spin_slider() {
Vector2 scale = get_global_transform_with_canvas().get_scale();
grabber->set_scale(scale);
grabber->reset_size();
grabber->set_position(get_global_position() + (grabber_rect.get_center() - grabber->get_size() * 0.5) * scale);
grabber->set_position((grabber_rect.get_center() - grabber->get_size() * 0.5) * scale);

if (mousewheel_over_grabber) {
Input::get_singleton()->warp_mouse(grabber->get_position() + grabber_rect.size);
Expand Down Expand Up @@ -737,7 +737,7 @@ EditorSpinSlider::EditorSpinSlider() {
grabber = memnew(TextureRect);
add_child(grabber);
grabber->hide();
grabber->set_as_top_level(true);
grabber->set_z_index(1);
grabber->set_mouse_filter(MOUSE_FILTER_STOP);
grabber->connect(SceneStringName(mouse_entered), callable_mp(this, &EditorSpinSlider::_grabber_mouse_entered));
grabber->connect(SceneStringName(mouse_exited), callable_mp(this, &EditorSpinSlider::_grabber_mouse_exited));
Expand Down

0 comments on commit 23ac81f

Please sign in to comment.