fix cursor bug in paint mode