Don't always increase height in DoGetSizeFromTextSize()

The intention here almost certainly was to use at least the specified
height, not to always add something to it at the end for no apparent
reason, so do this instead.
This commit is contained in:
Vadim Zeitlin 2023-02-02 17:09:06 +01:00
parent 3433eaafc2
commit 44e9218e03

View file

@ -2180,10 +2180,9 @@ wxSize wxTextCtrl::DoGetSizeFromTextSize(int xlen, int ylen) const
}
}
// Perhaps the user wants something different from CharHeight, or ylen
// is used as the height of a multiline text.
if ( ylen > 0 )
tsize.IncBy(0, ylen - cHeight);
// We should always use at least the specified height if it's valid.
if ( ylen > tsize.y )
tsize.y = ylen;
return tsize;
}