(Yes, the repaint logic is a mess).
My sincere apologies for my offensive comment. I'm aware that, by nature, any of my impression of the codebase is subjective, and I always recognize that there is nobody to blame for it given the current situation even if the code was, indeed, "a mess." Also, I'll try to refrain from using language that may sound to someone like I'm condemning them.
This also applies to MR 268. FWIW, it would be easier from a reviewer standpoint if these two MRs were merged into one MR containing two commits.
ACK. I merged them into MR !284.