Use correct size for the notebook background bitmap in wxMSW
Using "r.x + r.width" didn't really make much sense, it just happened to be close enough to the real value to not create any problems when using LTR layout, but was wrong in RTL, resulting in visible vertical line being visible in the notebook client area. Fix this using the same GetThemeBackgroundExtent() for determining the bitmap size as is used for drawing over it.
This commit is contained in:
@@ -1151,9 +1151,26 @@ WXHBRUSH wxNotebook::QueryBgBitmap()
|
||||
if ( r.IsEmpty() )
|
||||
return 0;
|
||||
|
||||
wxUxThemeHandle theme(this, L"TAB");
|
||||
if ( !theme )
|
||||
return 0;
|
||||
|
||||
RECT rc;
|
||||
wxCopyRectToRECT(r, rc);
|
||||
|
||||
WindowHDC hDC(GetHwnd());
|
||||
wxUxThemeEngine::Get()->GetThemeBackgroundExtent
|
||||
(
|
||||
theme,
|
||||
(HDC) hDC,
|
||||
9 /* TABP_PANE */,
|
||||
0,
|
||||
&rc,
|
||||
&rc
|
||||
);
|
||||
|
||||
MemoryHDC hDCMem(hDC);
|
||||
CompatibleBitmap hBmp(hDC, r.x + r.width, r.y + r.height);
|
||||
CompatibleBitmap hBmp(hDC, rc.right, rc.bottom);
|
||||
|
||||
SelectInHDC selectBmp(hDCMem, hBmp);
|
||||
|
||||
|
Reference in New Issue
Block a user