This should fix the wrong handling of BView::ClearOverlay() - probably, I haven't

tested it :-)


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17301 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler 2006-05-02 21:22:56 +00:00
parent f4c4106a40
commit 6736b21a2a

View File

@ -456,14 +456,16 @@ ViewLayer::SetViewBitmap(ServerBitmap* bitmap, BRect sourceRect,
BRect destRect, int32 resizingMode, int32 options) BRect destRect, int32 resizingMode, int32 options)
{ {
if (fViewBitmap != NULL) { if (fViewBitmap != NULL) {
Overlay* overlay = _Overlay();
if (bitmap != NULL) { if (bitmap != NULL) {
// take over overlay token from current overlay (if it has any) // take over overlay token from current overlay (if it has any)
Overlay* oldOverlay = _Overlay();
Overlay* newOverlay = bitmap->Overlay(); Overlay* newOverlay = bitmap->Overlay();
if (oldOverlay != NULL && newOverlay != NULL) if (overlay != NULL && newOverlay != NULL)
newOverlay->TakeOverToken(oldOverlay); newOverlay->TakeOverToken(overlay);
} } else if (overlay != NULL)
overlay->Hide();
gBitmapManager->DeleteBitmap(fViewBitmap); gBitmapManager->DeleteBitmap(fViewBitmap);
} }