painting: properly detect a change in start/end matches

The inversion of the logic in commit a6605dce was incomplete -- oops.

This fixes https://savannah.gnu.org/bugs/?50306.
1 file changed