Fix painter algo's for perspective transforms (see comments).