def _refreshKey(self, displayKey): """ Calculate the appropriate region of the screen to refresh based on the given displayKey. """ refreshRect = Rect(*displayKey.scaled) refreshRect.Inflate(2, 2) self.RefreshRect(refreshRect.Get())