From ffd2857571672ceb01c716a9ae0f661d9fc5621b Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Wed, 1 Apr 2015 14:15:11 +0200 Subject: [PATCH] Fix vertical alpha adjustment in wxPixelData::Offset(). Handle "y" parameter correctly when offsetting m_pAlpha, it was just ignored before, i.e. Offset(x, y) and OffsetY(y) always behaved as if y were 1. --- include/wx/rawbmp.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/wx/rawbmp.h b/include/wx/rawbmp.h index 1f89e5acc2..fae330a7e3 100644 --- a/include/wx/rawbmp.h +++ b/include/wx/rawbmp.h @@ -372,7 +372,7 @@ struct wxPixelDataOut { m_pRGB += data.GetRowStride()*y + PixelFormat::SizePixel*x; if ( m_pAlpha ) - m_pAlpha += data.GetWidth() + x; + m_pAlpha += data.GetWidth()*y + x; } // move x pixels to the right (again, no row wrapping) @@ -388,7 +388,7 @@ struct wxPixelDataOut { m_pRGB += data.GetRowStride()*y; if ( m_pAlpha ) - m_pAlpha += data.GetWidth(); + m_pAlpha += data.GetWidth()*y; } // go to the given position