mirror of
https://github.com/godotengine/godot.git
synced 2025-10-19 16:03:29 +00:00
Style: clang-format: Disable AllowShortIfStatementsOnASingleLine
Part of #33027, also discussed in #29848. Enforcing the use of brackets even on single line statements would be preferred, but `clang-format` doesn't have this functionality yet.
This commit is contained in:
parent
03b13e0c69
commit
e956e80c1f
130 changed files with 967 additions and 511 deletions
|
@ -103,13 +103,16 @@ bool Triangulate::snip(const Vector<Vector2> &p_contour, int u, int v, int w, in
|
|||
// To avoid that we allow zero-area triangles if all else failed.
|
||||
float threshold = relaxed ? -CMP_EPSILON : CMP_EPSILON;
|
||||
|
||||
if (threshold > (((Bx - Ax) * (Cy - Ay)) - ((By - Ay) * (Cx - Ax)))) return false;
|
||||
if (threshold > (((Bx - Ax) * (Cy - Ay)) - ((By - Ay) * (Cx - Ax))))
|
||||
return false;
|
||||
|
||||
for (p = 0; p < n; p++) {
|
||||
if ((p == u) || (p == v) || (p == w)) continue;
|
||||
if ((p == u) || (p == v) || (p == w))
|
||||
continue;
|
||||
Px = contour[V[p]].x;
|
||||
Py = contour[V[p]].y;
|
||||
if (is_inside_triangle(Ax, Ay, Bx, By, Cx, Cy, Px, Py, relaxed)) return false;
|
||||
if (is_inside_triangle(Ax, Ay, Bx, By, Cx, Cy, Px, Py, relaxed))
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
|
@ -119,7 +122,8 @@ bool Triangulate::triangulate(const Vector<Vector2> &contour, Vector<int> &resul
|
|||
/* allocate and initialize list of Vertices in polygon */
|
||||
|
||||
int n = contour.size();
|
||||
if (n < 3) return false;
|
||||
if (n < 3)
|
||||
return false;
|
||||
|
||||
Vector<int> V;
|
||||
V.resize(n);
|
||||
|
@ -161,11 +165,14 @@ bool Triangulate::triangulate(const Vector<Vector2> &contour, Vector<int> &resul
|
|||
|
||||
/* three consecutive vertices in current polygon, <u,v,w> */
|
||||
int u = v;
|
||||
if (nv <= u) u = 0; /* previous */
|
||||
if (nv <= u)
|
||||
u = 0; /* previous */
|
||||
v = u + 1;
|
||||
if (nv <= v) v = 0; /* new v */
|
||||
if (nv <= v)
|
||||
v = 0; /* new v */
|
||||
int w = v + 1;
|
||||
if (nv <= w) w = 0; /* next */
|
||||
if (nv <= w)
|
||||
w = 0; /* next */
|
||||
|
||||
if (snip(contour, u, v, w, nv, V, relaxed)) {
|
||||
int a, b, c, s, t;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue