1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-19 14:31:59 +00: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:
Rémi Verschelde
2020-05-14 16:41:43 +02:00
parent 07bc4e2f96
commit 0ee0fa42e6
683 changed files with 22803 additions and 12225 deletions

View File

@@ -64,8 +64,9 @@ Size2 ParallaxLayer::get_motion_offset() const {
}
void ParallaxLayer::_update_mirroring() {
if (!is_inside_tree())
if (!is_inside_tree()) {
return;
}
ParallaxBackground *pb = Object::cast_to<ParallaxBackground>(get_parent());
if (pb) {
@@ -78,10 +79,12 @@ void ParallaxLayer::_update_mirroring() {
void ParallaxLayer::set_mirroring(const Size2 &p_mirroring) {
mirroring = p_mirroring;
if (mirroring.x < 0)
if (mirroring.x < 0) {
mirroring.x = 0;
if (mirroring.y < 0)
}
if (mirroring.y < 0) {
mirroring.y = 0;
}
_update_mirroring();
}
@@ -107,10 +110,12 @@ void ParallaxLayer::_notification(int p_what) {
void ParallaxLayer::set_base_offset_and_scale(const Point2 &p_offset, float p_scale, const Point2 &p_screen_offset) {
screen_offset = p_screen_offset;
if (!is_inside_tree())
if (!is_inside_tree()) {
return;
if (Engine::get_singleton()->is_editor_hint())
}
if (Engine::get_singleton()->is_editor_hint()) {
return;
}
Point2 new_ofs = (screen_offset + (p_offset - screen_offset) * motion_scale) + motion_offset * p_scale + orig_offset * p_scale;