| 11 | } |
| 12 | |
| 13 | bool interpretFillRule(int intersections, FillRule fillRule) { |
| 14 | switch (fillRule) { |
| 15 | case FILL_NONZERO: |
| 16 | return intersections != 0; |
| 17 | case FILL_ODD: |
| 18 | return intersections&1; |
| 19 | case FILL_POSITIVE: |
| 20 | return intersections > 0; |
| 21 | case FILL_NEGATIVE: |
| 22 | return intersections < 0; |
| 23 | } |
| 24 | return false; |
| 25 | } |
| 26 | |
| 27 | double Scanline::overlap(const Scanline &a, const Scanline &b, double xFrom, double xTo, FillRule fillRule) { |
| 28 | double total = 0; |