Cache bufferviewer column width calculation

This commit is contained in:
baldurk
2020-09-02 15:12:10 +01:00
parent 31b81ade3c
commit da0c836aef
2 changed files with 9 additions and 0 deletions
+8
View File
@@ -3641,6 +3641,14 @@ void BufferViewer::ClearModels()
void BufferViewer::CalcColumnWidth(int maxNumRows)
{
// while the calculated column widths aren't actually isn't quite based on maxNumRows, it can only
// be affected by a style change so that is good enough for us to cache it and save time
// recalculating this repeatedly.
if(m_ColumnWidthRowCount == maxNumRows)
return;
m_ColumnWidthRowCount = maxNumRows;
ResourceFormat floatFmt;
floatFmt.compByteWidth = 4;
floatFmt.compType = CompType::Float;