refactor: sep. function for calculating area that needs repainted