Moved g_canvas to be able to scale grid to canvas