They don't explicitly use a bitmap but MSDN still says that their origin
should be set to align brushes used on different windows.
Closes #11072.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@61616
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
if ( brush.IsOk() )
{
// we must make sure the brush is aligned with the logical coordinates
if ( brush.IsOk() )
{
// we must make sure the brush is aligned with the logical coordinates
+ // before selecting it or using the same brush for the background of
+ // different windows would result in discontinuities
+ wxSize sizeBrushBitmap = wxDefaultSize;
wxBitmap *stipple = brush.GetStipple();
if ( stipple && stipple->IsOk() )
wxBitmap *stipple = brush.GetStipple();
if ( stipple && stipple->IsOk() )
+ sizeBrushBitmap = stipple->GetSize();
+ else if ( brush.IsHatch() )
+ sizeBrushBitmap = wxSize(8, 8);
+
+ if ( sizeBrushBitmap.IsFullySpecified() )
{
if ( !::SetBrushOrgEx
(
GetHdc(),
{
if ( !::SetBrushOrgEx
(
GetHdc(),
- m_deviceOriginX % stipple->GetWidth(),
- m_deviceOriginY % stipple->GetHeight(),
+ m_deviceOriginX % sizeBrushBitmap.x,
+ m_deviceOriginY % sizeBrushBitmap.y,
NULL // [out] previous brush origin
) )
{
NULL // [out] previous brush origin
) )
{