Separated vertices calculations from drawing code for use by hit-tests.
Also added polygon filling.