Commit dc32e3f7 authored by Cyril Deguet's avatar Cyril Deguet

* png_bitmap.cpp: fixed handling of PNG bitmaps with an alpha channel

 (was broken for quite a long time...)
* ctrl_tree.cpp: removed debug messages
parent 883daa52
......@@ -146,8 +146,6 @@ void CtrlTree::onUpdate( Subject<VarPercent> &rPercent )
int excessItems = m_rTree.visibleItems() - maxItems();
fprintf( stderr, "Hullo\n");
if( excessItems > 0)
{
VarPercent &rVarPos = m_rTree.getPositionVar();
......@@ -159,14 +157,11 @@ void CtrlTree::onUpdate( Subject<VarPercent> &rPercent )
}
if( m_lastPos != it )
{
fprintf( stderr, "updating\n" );
// Redraw the control if the position has changed
m_lastPos = it;
makeImage();
notifyLayout();
}
else
fprintf( stderr, "not updating\n" );
}
void CtrlTree::onResize()
......
......@@ -49,14 +49,24 @@ PngBitmap::PngBitmap( intf_thread_t *pIntf, image_handler_t *pImageHandler,
{
for( int x = 0; x < m_width; x++ )
{
uint32_t b = *(pData++) = *(pSrc++);
uint32_t g = *(pData++) = *(pSrc++);
uint32_t r = *(pData++) = *(pSrc++);
*pData = *pSrc;
uint32_t b = *(pSrc++);
uint32_t g = *(pSrc++);
uint32_t r = *(pSrc++);
uint8_t a = *(pSrc++);
*(pData++) = (b * a) >> 8;
*(pData++) = (g * a) >> 8;
*(pData++) = (r * a) >> 8;
// Transparent pixel ?
if( aColor == (r<<16 | g<<8 | b) ) *pData = 0;
pData++; pSrc++;
if( aColor == (r<<16 | g<<8 | b) )
{
*pData = 0;
}
else
{
*pData = a;
}
pData++;
}
pSrc += pPic->p->i_pitch - m_width * 4;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment