Use rect instead of line on canvas since it uses less code