fixed: polylines not always correctly painted