Fix canvas offset calculation
BUG:416352 (cherry picked from commit 510e56baaad81d7d2b270296f0a91ab27d24b299)