moved bounds checking from canvas event to tool
resolved issue where file wouldn't export if given an extension
moved calculation out of loop