This moves a couple of checks outside of the main drawing loop, since they're not going to change anyway.
Attach a file by drag & drop or click to upload