more clear the if is dependant
This commit is contained in:
parent
d097fda55b
commit
a39f3296c7
1 changed files with 9 additions and 7 deletions
|
@ -1207,11 +1207,12 @@ proc computeCoverages(
|
||||||
winding = partitioning.partitions[partitionIndex][i][1]
|
winding = partitioning.partitions[partitionIndex][i][1]
|
||||||
if segment.at.y <= scanline.a.y and segment.to.y >= scanline.a.y:
|
if segment.at.y <= scanline.a.y and segment.to.y >= scanline.a.y:
|
||||||
var at: Vec2
|
var at: Vec2
|
||||||
if scanline.intersects(segment, at) and segment.to != at:
|
if scanline.intersects(segment, at):
|
||||||
if numHits == hits.len:
|
if segment.to != at:
|
||||||
hits.setLen(hits.len * 2)
|
if numHits == hits.len:
|
||||||
hits[numHits] = (min(at.x, size.x), winding)
|
hits.setLen(hits.len * 2)
|
||||||
inc numHits
|
hits[numHits] = (min(at.x, size.x), winding)
|
||||||
|
inc numHits
|
||||||
|
|
||||||
if hits.len > 32:
|
if hits.len > 32:
|
||||||
quickSort(hits, 0, numHits - 1)
|
quickSort(hits, 0, numHits - 1)
|
||||||
|
@ -1905,8 +1906,9 @@ proc overlaps(
|
||||||
winding = segments[i][1]
|
winding = segments[i][1]
|
||||||
if segment.at.y <= scanline.a.y and segment.to.y >= scanline.a.y:
|
if segment.at.y <= scanline.a.y and segment.to.y >= scanline.a.y:
|
||||||
var at: Vec2
|
var at: Vec2
|
||||||
if scanline.intersects(segment, at) and segment.to != at:
|
if scanline.intersects(segment, at):
|
||||||
hits.add((at.x, winding))
|
if segment.to != at:
|
||||||
|
hits.add((at.x, winding))
|
||||||
|
|
||||||
if hits.len > 32:
|
if hits.len > 32:
|
||||||
quickSort(hits, 0, hits.high)
|
quickSort(hits, 0, hits.high)
|
||||||
|
|
Loading…
Reference in a new issue