Reset canvas state before drawing annotations

Rebasing of #3040