refactored set canvas translation to separate method