if(type == PathIterator.SEG_MOVETO){
lastPoint = new Point2D.Double(coords[0], coords[1]);
}else if(type == PathIterator.SEG_LINETO){
assert(lastPoint != null);//this must be after a point of type 0
SGLine line = new SGLine((int)Math.round(lastPoint.x), (int)Math.round(lastPoint.y), (int)Math.round(coords[0]), (int)Math.round(coords[1]));
objects.add(line);
lastPoint = new Point2D.Double(coords[0], coords[1]);
//System.out.println("Adding line "+line);
}