mirror of
https://github.com/godotengine/godot.git
synced 2026-01-05 06:11:29 +03:00
Style: Enforce braces around if blocks and loops
Using clang-tidy's `readability-braces-around-statements`. https://clang.llvm.org/extra/clang-tidy/checks/readability-braces-around-statements.html
This commit is contained in:
@@ -46,8 +46,9 @@ String EditorSpinSlider::get_text_value() const {
|
||||
}
|
||||
|
||||
void EditorSpinSlider::_gui_input(const Ref<InputEvent> &p_event) {
|
||||
if (read_only)
|
||||
if (read_only) {
|
||||
return;
|
||||
}
|
||||
|
||||
Ref<InputEventMouseButton> mb = p_event;
|
||||
if (mb.is_valid()) {
|
||||
@@ -83,8 +84,9 @@ void EditorSpinSlider::_gui_input(const Ref<InputEvent> &p_event) {
|
||||
}
|
||||
}
|
||||
} else if (mb->get_button_index() == BUTTON_WHEEL_UP || mb->get_button_index() == BUTTON_WHEEL_DOWN) {
|
||||
if (grabber->is_visible())
|
||||
if (grabber->is_visible()) {
|
||||
call_deferred("update");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -168,8 +170,9 @@ void EditorSpinSlider::_grabber_gui_input(const Ref<InputEvent> &p_event) {
|
||||
|
||||
Ref<InputEventMouseMotion> mm = p_event;
|
||||
if (mm.is_valid() && grabbing_grabber) {
|
||||
if (mousewheel_over_grabber)
|
||||
if (mousewheel_over_grabber) {
|
||||
return;
|
||||
}
|
||||
|
||||
float scale_x = get_global_transform_with_canvas().get_scale().x;
|
||||
ERR_FAIL_COND(Math::is_zero_approx(scale_x));
|
||||
@@ -375,8 +378,9 @@ void EditorSpinSlider::_evaluate_input_text() {
|
||||
}
|
||||
|
||||
Variant v = expr->execute(Array(), nullptr, false);
|
||||
if (v.get_type() == Variant::NIL)
|
||||
if (v.get_type() == Variant::NIL) {
|
||||
return;
|
||||
}
|
||||
set_value(v);
|
||||
}
|
||||
|
||||
@@ -395,8 +399,9 @@ void EditorSpinSlider::_value_input_closed() {
|
||||
//focus_exited signal
|
||||
void EditorSpinSlider::_value_focus_exited() {
|
||||
// discontinue because the focus_exit was caused by right-click context menu
|
||||
if (value_input->get_menu()->is_visible())
|
||||
if (value_input->get_menu()->is_visible()) {
|
||||
return;
|
||||
}
|
||||
|
||||
_evaluate_input_text();
|
||||
// focus is not on the same element after the vlalue_input was exited
|
||||
|
||||
Reference in New Issue
Block a user