mirror of
https://github.com/godotengine/godot.git
synced 2025-10-20 00:13:30 +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:
parent
b8d198eeed
commit
140350d767
694 changed files with 23283 additions and 12499 deletions
|
@ -178,10 +178,11 @@ void SpriteEditor::_update_mesh_data() {
|
|||
}
|
||||
|
||||
Rect2 rect;
|
||||
if (node->is_region())
|
||||
if (node->is_region()) {
|
||||
rect = node->get_region_rect();
|
||||
else
|
||||
} else {
|
||||
rect.size = Size2(image->get_width(), image->get_height());
|
||||
}
|
||||
|
||||
Ref<BitMap> bm;
|
||||
bm.instance();
|
||||
|
@ -223,13 +224,16 @@ void SpriteEditor::_update_mesh_data() {
|
|||
vtx -= rect.position; //offset by rect position
|
||||
|
||||
//flip if flipped
|
||||
if (node->is_flipped_h())
|
||||
if (node->is_flipped_h()) {
|
||||
vtx.x = rect.size.x - vtx.x - 1.0;
|
||||
if (node->is_flipped_v())
|
||||
}
|
||||
if (node->is_flipped_v()) {
|
||||
vtx.y = rect.size.y - vtx.y - 1.0;
|
||||
}
|
||||
|
||||
if (node->is_centered())
|
||||
if (node->is_centered()) {
|
||||
vtx -= rect.size / 2.0;
|
||||
}
|
||||
|
||||
computed_vertices.push_back(vtx);
|
||||
}
|
||||
|
@ -270,13 +274,16 @@ void SpriteEditor::_update_mesh_data() {
|
|||
vtx -= rect.position; //offset by rect position
|
||||
|
||||
//flip if flipped
|
||||
if (node->is_flipped_h())
|
||||
if (node->is_flipped_h()) {
|
||||
vtx.x = rect.size.x - vtx.x - 1.0;
|
||||
if (node->is_flipped_v())
|
||||
}
|
||||
if (node->is_flipped_v()) {
|
||||
vtx.y = rect.size.y - vtx.y - 1.0;
|
||||
}
|
||||
|
||||
if (node->is_centered())
|
||||
if (node->is_centered()) {
|
||||
vtx -= rect.size / 2.0;
|
||||
}
|
||||
|
||||
col.write[i] = vtx;
|
||||
}
|
||||
|
@ -346,8 +353,9 @@ void SpriteEditor::_convert_to_polygon_2d_node() {
|
|||
Polygon2D *polygon_2d_instance = memnew(Polygon2D);
|
||||
|
||||
int total_point_count = 0;
|
||||
for (int i = 0; i < computed_outline_lines.size(); i++)
|
||||
for (int i = 0; i < computed_outline_lines.size(); i++) {
|
||||
total_point_count += computed_outline_lines[i].size();
|
||||
}
|
||||
|
||||
PoolVector2Array polygon;
|
||||
polygon.resize(total_point_count);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue