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;
+1
View File
@@ -208,6 +208,7 @@ private:
RDTableView *m_CurView = NULL;
int m_ContextColumn = -1;
int m_ColumnWidthRowCount = -1;
int m_IdxColWidth;
int m_DataColWidth;
int m_DataRowHeight;