* If bitmaps are drawn with alpha channel, it helps to setup the correct
alpha mode. Thanks to Ralf Schuelke for pointing this out. * Also check the bitmap color space and only use alpha drawing for bitmaps with valid alpha channel. * Don't just reset the parent to B_OP_OVER, but use the previous mode. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24031 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
8ad2eabab3
commit
bbf31e4d1f
@ -596,9 +596,20 @@ BBitmapColumn::DrawField(BField* field, BRect rect, BView* parent)
|
||||
x = rect.right - kTEXT_MARGIN - r.Width();
|
||||
break;
|
||||
}
|
||||
parent->SetDrawingMode(B_OP_ALPHA);
|
||||
// setup drawing mode according to bitmap color space,
|
||||
// restore previous mode after drawing
|
||||
drawing_mode oldMode = parent->DrawingMode();
|
||||
if (bitmap->ColorSpace() == B_RGBA32
|
||||
|| bitmap->ColorSpace() == B_RGBA32_BIG) {
|
||||
parent->SetDrawingMode(B_OP_ALPHA);
|
||||
parent->SetBlendingMode(B_PIXEL_ALPHA, B_ALPHA_OVERLAY);
|
||||
} else {
|
||||
parent->SetDrawingMode(B_OP_OVER);
|
||||
}
|
||||
|
||||
parent->DrawBitmap(bitmap, BPoint(x, y));
|
||||
parent->SetDrawingMode(B_OP_OVER);
|
||||
|
||||
parent->SetDrawingMode(oldMode);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user