Fix bug in ribbon bar label size calculation.
Due to an off by 1 error in wxString::Mid() call, the size computed was too small and hence the label could have been not displayed at all. Fix this and also replace Mid(0, n) with a more clear Left(n) call. Closes #14566. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@72348 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
parent
70f86dedfd
commit
083ec26fb7
@ -2889,7 +2889,7 @@ bool wxRibbonMSWArtProvider::GetButtonBarButtonSize(
|
||||
if(wxRibbonCanLabelBreakAtPosition(label, i))
|
||||
{
|
||||
int width = wxMax(
|
||||
dc.GetTextExtent(label.Mid(0, i - 1)).GetWidth(),
|
||||
dc.GetTextExtent(label.Left(i)).GetWidth(),
|
||||
dc.GetTextExtent(label.Mid(i + 1)).GetWidth() + last_line_extra_width);
|
||||
if(width < best_width)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user