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
This commit is contained in:
stippi
2012-07-03 15:43:56 +02:00
committed by Alexandre Deckner
parent 9f30678a67
commit 27dab3e5fe
+8 -8
View File
@@ -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);
}