Spark Line-drawing speed issues

I, after way too many hours of going through my code, finall found out why the linedrawing part of my latest flex 4 project ran really slow.

Spark (and probably all other versions of the linedrawing routine in Flash) runs really slow if the end points end up ‘inbetween’ pixels. Convert the start and end positions to int before drawing and you’ll see a massive speed increase.