Fix drawing right and bottom wxMSW wxStaticBox edges in high DPI
Passing window size divided by "scale" to CreateWithDIPSize() was wrong as the resulting bitmap could be too small to cover the entire window due to rounding errors, e.g. at 200% DPI the right and bottom row/column was never drawn on if the window size in the corresponding direction was odd. This notably fixes their (dis)appearance in dark mode, where we always draw them ourselves (otherwise we mostly only do it when using non-default colour).
This commit is contained in:
parent
e97d27165a
commit
97468661c7
1 changed files with 2 additions and 2 deletions
|
|
@ -718,8 +718,8 @@ void wxStaticBox::OnPaint(wxPaintEvent& WXUNUSED(event))
|
|||
wxMemoryDC memdc(&dc);
|
||||
|
||||
const double scale = dc.GetContentScaleFactor();
|
||||
wxBitmap bitmap;
|
||||
bitmap.CreateWithDIPSize(rc.right / scale, rc.bottom / scale, scale);
|
||||
wxBitmap bitmap(rc.right, rc.bottom);
|
||||
bitmap.SetScaleFactor(scale);
|
||||
memdc.SelectObject(bitmap);
|
||||
|
||||
PaintBackground(memdc, rc);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue