Restore context opacity after drawing layers

Closes #2455