hide palettes when clicking anywhere outside the toolbar
prevent overscroll on iOS
improve touch drawing