Fix off by one for when a shape is complete.
Split out rendering helpers to their own file.