Rather than check the cursor/canvas bounds everywhere else, do it once in the main handler. Related: #66, #68