Slightly simplify wxGrid refresh logic

Use new ShouldRefresh() helper instead of testing for !GetBatchCount()
before calling Refresh().

Also check for GetBatchCount() inside CalcDimensions() itself, which
means that it can now be called unconditionally.

No real changes.
This commit is contained in:
Vadim Zeitlin
2020-02-18 23:30:48 +01:00
parent 586d0e6ee6
commit 05c5891bf6
2 changed files with 63 additions and 60 deletions

View File

@@ -2454,6 +2454,12 @@ private:
// release the mouse capture if it's currently captured
void EndDraggingIfNecessary();
// return true if the grid should be refreshed right now
bool ShouldRefresh() const
{
return !GetBatchCount() && IsShownOnScreen();
}
// return the position (not index) of the column at the given logical pixel
// position