Improved scaling and mapping for displaying tests on canvas