Skip to content

Commit

Permalink
Merge pull request #49572 from azagaya/fix_grabber_area
Browse files Browse the repository at this point in the history
Fix vertical slider grabber_area height calculation
  • Loading branch information
akien-mga authored Jun 14, 2021
2 parents dedb314 + be86679 commit 16027e7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion scene/gui/slider.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ void Slider::_notification(int p_what) {
int widget_width = style->get_minimum_size().width + style->get_center_size().width;
float areasize = size.height - grabber->get_size().height;
style->draw(ci, Rect2i(Point2i(size.width / 2 - widget_width / 2, 0), Size2i(widget_width, size.height)));
grabber_area->draw(ci, Rect2i(Point2i((size.width - widget_width) / 2, size.height - areasize * ratio - grabber->get_size().height / 2), Size2i(widget_width, areasize * ratio + grabber->get_size().width / 2)));
grabber_area->draw(ci, Rect2i(Point2i((size.width - widget_width) / 2, size.height - areasize * ratio - grabber->get_size().height / 2), Size2i(widget_width, areasize * ratio + grabber->get_size().height / 2)));

if (ticks > 1) {
int grabber_offset = (grabber->get_size().height / 2 - tick->get_height() / 2);
Expand Down

0 comments on commit 16027e7

Please sign in to comment.