* 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:
@@ -596,9 +596,20 @@ BBitmapColumn::DrawField(BField* field, BRect rect, BView* parent)
|
|||||||
x = rect.right - kTEXT_MARGIN - r.Width();
|
x = rect.right - kTEXT_MARGIN - r.Width();
|
||||||
break;
|
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->DrawBitmap(bitmap, BPoint(x, y));
|
||||||
parent->SetDrawingMode(B_OP_OVER);
|
|
||||||
|
parent->SetDrawingMode(oldMode);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user