canvas is now resizable, refactored edge ending calculation