dynamically centering and aligning canvas object