Replace DOM draw check with matrix check