fix an issue with selection rects not being redrawn correctly