Mac: Adjust wxDataViewCtrl column width calculator
Slightly improve the maximum column width calculator by rounding up the (non-integer) width of cells using ceil() instead of adding 1 unconditionally. See #19003.
This commit is contained in:
@@ -2198,7 +2198,7 @@ void wxCocoaDataViewControl::FitColumnWidthToContent(unsigned int pos)
|
|||||||
void UpdateWithRow(int row)
|
void UpdateWithRow(int row)
|
||||||
{
|
{
|
||||||
NSCell *cell = [m_view preparedCellAtColumn:m_column row:row];
|
NSCell *cell = [m_view preparedCellAtColumn:m_column row:row];
|
||||||
unsigned cellWidth = [cell cellSize].width + 1/*round the float up*/;
|
unsigned cellWidth = ceil([cell cellSize].width);
|
||||||
|
|
||||||
if ( m_indent )
|
if ( m_indent )
|
||||||
cellWidth += m_indent * [m_view levelForRow:row];
|
cellWidth += m_indent * [m_view levelForRow:row];
|
||||||
@@ -2228,7 +2228,7 @@ void wxCocoaDataViewControl::FitColumnWidthToContent(unsigned int pos)
|
|||||||
|
|
||||||
if ( [column headerCell] )
|
if ( [column headerCell] )
|
||||||
{
|
{
|
||||||
calculator.UpdateWithWidth([[column headerCell] cellSize].width + 1/*round the float up*/);
|
calculator.UpdateWithWidth(ceil([[column headerCell] cellSize].width));
|
||||||
}
|
}
|
||||||
|
|
||||||
// The code below deserves some explanation. For very large controls, we
|
// The code below deserves some explanation. For very large controls, we
|
||||||
|
Reference in New Issue
Block a user