Call AdjustForBitmapMargins() only once in wxAnyButton
No real changes, just a tiny refactoring to avoid duplicating exactly the same function call.
This commit is contained in:
@@ -589,9 +589,6 @@ wxSize wxAnyButton::DoGetBestSize() const
|
|||||||
SIZE idealSize = { 0, 0 };
|
SIZE idealSize = { 0, 0 };
|
||||||
if ( ::SendMessage(GetHwnd(), BCM_GETIDEALSIZE, 0, (LPARAM)&idealSize) )
|
if ( ::SendMessage(GetHwnd(), BCM_GETIDEALSIZE, 0, (LPARAM)&idealSize) )
|
||||||
size.Set(idealSize.cx, idealSize.cy);
|
size.Set(idealSize.cx, idealSize.cy);
|
||||||
|
|
||||||
if ( m_imageData )
|
|
||||||
AdjustForBitmapMargins(size);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// If we failed to set the size using BCM_GETIDEALSIZE above, determine it
|
// If we failed to set the size using BCM_GETIDEALSIZE above, determine it
|
||||||
@@ -621,11 +618,11 @@ wxSize wxAnyButton::DoGetBestSize() const
|
|||||||
size = wxMSWButton::ComputeBestFittingSize(self, flags);
|
size = wxMSWButton::ComputeBestFittingSize(self, flags);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( m_imageData )
|
|
||||||
AdjustForBitmapSize(size);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ( m_imageData )
|
||||||
|
AdjustForBitmapMargins(size);
|
||||||
|
|
||||||
return wxMSWButton::IncreaseToStdSizeAndCache(self, size);
|
return wxMSWButton::IncreaseToStdSizeAndCache(self, size);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user