bounds checking for the brush