Fix wxRegion::Offset() copy on write behaviour in wxMSW.

Offset the correct, new and unshared, region handle instead of the old and
possibly shared one.

Closes #15690.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@75251 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2013-11-20 12:01:31 +00:00
parent 214aebee08
commit 89ef594505

View File

@@ -164,8 +164,7 @@ void wxRegion::Clear()
bool wxRegion::DoOffset(wxCoord x, wxCoord y)
{
const HRGN hrgn = GetHrgn();
wxCHECK_MSG( hrgn, false, wxT("invalid wxRegion") );
wxCHECK_MSG( GetHrgn(), false, wxT("invalid wxRegion") );
if ( !x && !y )
{
@@ -175,7 +174,7 @@ bool wxRegion::DoOffset(wxCoord x, wxCoord y)
AllocExclusive();
if ( ::OffsetRgn(hrgn, x, y) == ERROR )
if ( ::OffsetRgn(GetHrgn(), x, y) == ERROR )
{
wxLogLastError(wxT("OffsetRgn"));