Minor drawing UI bugfixes

When I draw with the right mouse button and accidentally release it when the cursor is outside of canvas, context menu opens. It's rather annoying, so I have fixed it.

Also the brush size selection buttons now are in sync with actual brush size when switching it by keyboard.