diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2020-05-14 16:41:43 +0200 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2020-05-14 21:57:34 +0200 |
commit | 0ee0fa42e6639b6fa474b7cf6afc6b1a78142185 (patch) | |
tree | 198d4ff7665d89307f6ca2469fa38620a9eb1672 /editor/plugins/texture_layered_editor_plugin.cpp | |
parent | 07bc4e2f96f8f47991339654ff4ab16acc19d44f (diff) |
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
Diffstat (limited to 'editor/plugins/texture_layered_editor_plugin.cpp')
-rw-r--r-- | editor/plugins/texture_layered_editor_plugin.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/editor/plugins/texture_layered_editor_plugin.cpp b/editor/plugins/texture_layered_editor_plugin.cpp index e0e5bdb407..59e87fb273 100644 --- a/editor/plugins/texture_layered_editor_plugin.cpp +++ b/editor/plugins/texture_layered_editor_plugin.cpp @@ -64,8 +64,9 @@ void TextureLayeredEditor::_notification(int p_what) { } void TextureLayeredEditor::_changed_callback(Object *p_changed, const char *p_prop) { - if (!is_visible()) + if (!is_visible()) { return; + } update(); } @@ -156,10 +157,12 @@ void TextureLayeredEditor::_texture_rect_update_area() { } // Prevent the texture from being unpreviewable after the rescale, so that we can still see something - if (tex_height <= 0) + if (tex_height <= 0) { tex_height = 1; - if (tex_width <= 0) + } + if (tex_width <= 0) { tex_width = 1; + } int ofs_x = (size.width - tex_width) / 2; int ofs_y = (size.height - tex_height) / 2; @@ -169,8 +172,9 @@ void TextureLayeredEditor::_texture_rect_update_area() { } void TextureLayeredEditor::edit(Ref<TextureLayered> p_texture) { - if (!texture.is_null()) + if (!texture.is_null()) { texture->remove_change_receptor(this); + } texture = p_texture; |