From 27dab3e5fe5e7f8115d8db88f82508168faf27e9 Mon Sep 17 00:00:00 2001 From: stippi Date: Mon, 3 May 2010 18:01:38 +0000 Subject: [PATCH] Make sure never to draw the favicon too big, in case we only got a big one from the page, and use the proper drawing mode and filtering. git-svn-id: http://svn.haiku-os.org/webpositive/webkit/trunk@479 94f232f2-1747-11df-bad5-a5bfde151594 --- src/apps/webpositive/URLInputGroup.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/apps/webpositive/URLInputGroup.cpp b/src/apps/webpositive/URLInputGroup.cpp index 40805943fc..d5f4888234 100644 --- a/src/apps/webpositive/URLInputGroup.cpp +++ b/src/apps/webpositive/URLInputGroup.cpp @@ -532,7 +532,8 @@ public: BView("page icon view", B_WILL_DRAW | B_FULL_UPDATE_ON_RESIZE), fIcon(NULL) { - SetDrawingMode(B_OP_OVER); + SetDrawingMode(B_OP_ALPHA); + SetBlendingMode(B_PIXEL_ALPHA, B_ALPHA_OVERLAY); } ~PageIconView() @@ -546,21 +547,20 @@ public: return; BRect bounds(Bounds()); - BRect iconBounds(fIcon->Bounds()); - BPoint iconPos( + BRect iconBounds(0, 0, 15, 15); + iconBounds.OffsetTo( floorf((bounds.left + bounds.right - (iconBounds.left + iconBounds.right)) / 2 + 0.5f), floorf((bounds.top + bounds.bottom - (iconBounds.top + iconBounds.bottom)) / 2 + 0.5f)); - DrawBitmap(fIcon, iconPos); + DrawBitmap(fIcon, fIcon->Bounds(), iconBounds, + B_FILTER_BITMAP_BILINEAR); } virtual BSize MinSize() { - if (fIcon != NULL) { - return BSize(fIcon->Bounds().Width() + 3, - fIcon->Bounds().Height() + 3); - } + if (fIcon != NULL) + return BSize(18, 18); return BSize(0, 0); }