From 62f8950e0efb1f5b69d72da3927f7bb8d6c995d5 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Wed, 1 Apr 2015 14:20:10 +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. --- docs/changes.txt | 1 + include/wx/rawbmp.h | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/changes.txt b/docs/changes.txt index b1d3f78a0a..ac8a75c52c 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -590,6 +590,7 @@ All (GUI): - Fix handling of fast consecutive clicks in wxRibbonBar (atobi). - Fix updating nested window scrollbars in some cases (sbrowne). - Fix wxPGChoices copy ctor (Snoits). +- Fix wxPixelData::Offset() for alpha (Markus Rollmann). wxGTK: diff --git a/include/wx/rawbmp.h b/include/wx/rawbmp.h index adcf81f398..fa404a1f1b 100644 --- a/include/wx/rawbmp.h +++ b/include/wx/rawbmp.h @@ -381,7 +381,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) @@ -397,7 +397,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