From b1ddb3c032799af7cc486a34a4518dcdb27410c6 Mon Sep 17 00:00:00 2001 From: plfiorini Date: Mon, 10 May 2010 22:42:54 +0000 Subject: [PATCH] Use B_FILTER_BITMAP_BILINEAR. --- application/views/RosterItem.cpp | 3 ++- libs/libinterface/BitmapMenuItem.cpp | 3 ++- libs/libinterface/PictureView.cpp | 11 ++++++----- libs/libinterface/ToolButton.cpp | 16 ++++++++-------- 4 files changed, 18 insertions(+), 15 deletions(-) diff --git a/application/views/RosterItem.cpp b/application/views/RosterItem.cpp index 8cd9fc1..61c8185 100644 --- a/application/views/RosterItem.cpp +++ b/application/views/RosterItem.cpp @@ -153,7 +153,8 @@ void RosterItem::DrawItem(BView* owner, BRect frame, bool complete) BRect rect(frame.right - h - 2, frame.top + 2, frame.right - 2, frame.top + h ); owner->SetDrawingMode(B_OP_ALPHA); owner->SetBlendingMode(B_PIXEL_ALPHA, B_ALPHA_OVERLAY); - owner->DrawBitmap(fBitmap, rect); + owner->DrawBitmap(fBitmap, fBitmap->Bounds(), + rect, B_FILTER_BITMAP_BILINEAR); } owner->SetHighColor(highColor); diff --git a/libs/libinterface/BitmapMenuItem.cpp b/libs/libinterface/BitmapMenuItem.cpp index 6d6093b..cea2586 100644 --- a/libs/libinterface/BitmapMenuItem.cpp +++ b/libs/libinterface/BitmapMenuItem.cpp @@ -94,7 +94,8 @@ BitmapMenuItem::DrawContent(void) if (fBitmap) { Menu()->PushState(); Menu()->SetDrawingMode(B_OP_ALPHA); - Menu()->DrawBitmap(fBitmap, fBitmap->Bounds(), drawrect); + Menu()->SetBlendingMode(B_PIXEL_ALPHA, B_ALPHA_OVERLAY); + Menu()->DrawBitmap(fBitmap, fBitmap->Bounds(), drawrect, B_FILTER_BITMAP_BILINEAR); Menu()->PopState(); } } diff --git a/libs/libinterface/PictureView.cpp b/libs/libinterface/PictureView.cpp index 92863e3..bfbe7c9 100644 --- a/libs/libinterface/PictureView.cpp +++ b/libs/libinterface/PictureView.cpp @@ -76,9 +76,10 @@ PictureView::PreferredSize() void PictureView::Draw(BRect frame) { - SetDrawingMode(B_OP_ALPHA); - SetBlendingMode(B_PIXEL_ALPHA, B_ALPHA_OVERLAY); - - if (fBitmap) - DrawBitmap(fBitmap, BPoint(0, 0)); + if (fBitmap) { + SetDrawingMode(B_OP_ALPHA); + SetBlendingMode(B_PIXEL_ALPHA, B_ALPHA_OVERLAY); + DrawBitmap(fBitmap, fBitmap->Bounds(), + Bounds(), B_FILTER_BITMAP_BILINEAR); + } } diff --git a/libs/libinterface/ToolButton.cpp b/libs/libinterface/ToolButton.cpp index 77a4ea4..3745218 100644 --- a/libs/libinterface/ToolButton.cpp +++ b/libs/libinterface/ToolButton.cpp @@ -132,15 +132,15 @@ ToolButton::Draw(BRect updateRect) SetDrawingMode(B_OP_ALPHA); SetBlendingMode(B_PIXEL_ALPHA, B_ALPHA_OVERLAY); - BPoint center = _Center(bounds); - center.x -= kToolbarIconSize / 2; - center.y -= kToolbarIconSize / 2; + BRect frame(bounds); + BPoint center = _Center(frame); + frame.bottom = frame.top + kToolbarIconSize + 4; + frame.top += 2; + frame.left = center.x - (kToolbarIconSize / 2); + frame.right = center.x + (kToolbarIconSize / 2); - BBitmap* bitmap = RescaleBitmap(fBitmap, kToolbarIconSize, - kToolbarIconSize); - DrawBitmap(bitmap, center); - - bounds.top = center.y + kToolbarIconSize + 2; + DrawBitmap(fBitmap, fBitmap->Bounds(), frame, B_FILTER_BITMAP_BILINEAR); + bounds.top = frame.bottom; } // Draw label