diff options
Diffstat (limited to 'scene/gui')
-rw-r--r-- | scene/gui/scroll_bar.cpp | 41 | ||||
-rw-r--r-- | scene/gui/tree.cpp | 5 |
2 files changed, 21 insertions, 25 deletions
diff --git a/scene/gui/scroll_bar.cpp b/scene/gui/scroll_bar.cpp index 686d1c96cc..a7c15151ae 100644 --- a/scene/gui/scroll_bar.cpp +++ b/scene/gui/scroll_bar.cpp @@ -439,27 +439,26 @@ double ScrollBar::get_grabber_size() const { } double ScrollBar::get_area_size() const { - - if (orientation == VERTICAL) { - - double area = get_size().height; - area -= get_stylebox("scroll")->get_minimum_size().height; - area -= get_icon("increment")->get_height(); - area -= get_icon("decrement")->get_height(); - area -= get_grabber_min_size(); - return area; - - } else if (orientation == HORIZONTAL) { - - double area = get_size().width; - area -= get_stylebox("scroll")->get_minimum_size().width; - area -= get_icon("increment")->get_width(); - area -= get_icon("decrement")->get_width(); - area -= get_grabber_min_size(); - return area; - } else { - - return 0; + switch (orientation) { + case VERTICAL: { + double area = get_size().height; + area -= get_stylebox("scroll")->get_minimum_size().height; + area -= get_icon("increment")->get_height(); + area -= get_icon("decrement")->get_height(); + area -= get_grabber_min_size(); + return area; + } break; + case HORIZONTAL: { + double area = get_size().width; + area -= get_stylebox("scroll")->get_minimum_size().width; + area -= get_icon("increment")->get_width(); + area -= get_icon("decrement")->get_width(); + area -= get_grabber_min_size(); + return area; + } break; + default: { + return 0.0; + } } } diff --git a/scene/gui/tree.cpp b/scene/gui/tree.cpp index 522c1ecb6a..54370d02ba 100644 --- a/scene/gui/tree.cpp +++ b/scene/gui/tree.cpp @@ -3163,10 +3163,7 @@ bool Tree::is_anything_selected() { void Tree::clear() { - if (blocked > 0) { - - ERR_FAIL_COND(blocked > 0); - } + ERR_FAIL_COND(blocked > 0); if (pressing_for_editor) { if (range_drag_enabled) { |