Account for the extra border around the thumb in wxMSW wxSlider

Without the extra margin, part of the thumb was truncated when
wxSL_TICKS was not used, but wxSL_BOTH (which makes the thumb bigger
than without it) was.
This commit is contained in:
Vadim Zeitlin
2020-05-24 22:26:56 +02:00
parent 93318b2628
commit e9e14063f2

View File

@@ -548,7 +548,11 @@ wxSize wxSlider::DoGetBestSize() const
{
// this value is arbitrary:
const int length = FromDIP(100);
const int thumbSize = GetThumbLength();
// We need 2 extra pixels (which are not scaled by the DPI by the native
// control) on either side to account for the focus rectangle.
const int thumbSize = GetThumbLength() + 4;
const int tickSize = FromDIP(TICK);
int *width;