title: scanline: finding intersection points
body: <p>I want to fill a polygon with the scanline algorith. for this I have to know all points where the scanline comes in contact with the polygon.
  I wrote a loop for this, but its obviously not working (it never adds a point to the list which means it can't find any points which cuts the polygon)
  I can create a Polygon and have all Edges from it.</p>
  
  <p>Here is my code for getting the points of the scanline which intersect the polygon
  xmin, xmax, ymin and ymax are the max points from the polygon. They are also correct. contains() checks, if a Point is inside the polygon, with using the java.awt.Polygon class. This is working too.
  wasInside contains a boolean, which saves the old state, if the last point checked was inside the polygon or not.</p>
  
  <pre><code>boolean wasInside = false;
  ArrayList&lt;Point&gt; intersectionPoints = new ArrayList&lt;Point&gt;();
      for (int yTemp = ymin; yTemp &lt;= ymax; yTemp++) {
          for (int xTemp = xmin; xTemp &lt;= xmax; xTemp++) {
              if (wasInside != this.contains(new Point(xTemp, yTemp))) {
                  intersectionPoints.add(new Point(xTemp, yTemp));
                  wasInside = !wasInside;
              }
          }
      }
  </code></pre>