Fix nan problem in previous bevel commit.

For chains, access to g_prod[0] was undefined.
And two minor style (whitespace) changes.
This commit is contained in:
Howard Trickey
2018-01-29 10:01:19 -05:00
parent 263efb0b9a
commit cebc7bb198
4 changed files with 6 additions and 7 deletions

View File

@@ -1985,6 +1985,7 @@ static bool adjust_the_cycle_or_chain_fast(BoundVert *vstart, int np, bool iscyc
g_prod[i] = gprod;
gprod_sum += gprod;
}
g_prod[0] = 1.0f;
if (iscycle) {
gprod *= g[0];
if (fabs(gprod - 1.0f) > BEVEL_EPSILON) {
@@ -1993,8 +1994,6 @@ static bool adjust_the_cycle_or_chain_fast(BoundVert *vstart, int np, bool iscyc
MEM_freeN(g_prod);
return false;
}
else
g_prod[0] = 1.0f;
}
if (gprod_sum == 0.0f) {
MEM_freeN(g);