From e71c5717b1aa65043bbef09830a474257e05403b Mon Sep 17 00:00:00 2001 From: stippi Date: Mon, 26 Jul 2010 12:05:26 +0000 Subject: [PATCH] Account for the fact that the visible frame of a tab is one pixel larger at the bottom. Will fix Haiku ticket #6383 when a new package is made available. git-svn-id: http://svn.haiku-os.org/webpositive/webkit/trunk@539 94f232f2-1747-11df-bad5-a5bfde151594 --- src/apps/webpositive/tabview/TabContainerView.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/apps/webpositive/tabview/TabContainerView.cpp b/src/apps/webpositive/tabview/TabContainerView.cpp index 73457eaf5b..483a692749 100644 --- a/src/apps/webpositive/tabview/TabContainerView.cpp +++ b/src/apps/webpositive/tabview/TabContainerView.cpp @@ -429,9 +429,14 @@ TabContainerView::_TabAt(const BPoint& where) const BGroupLayout* layout = GroupLayout(); int32 count = layout->CountItems() - 1; for (int32 i = 0; i < count; i++) { - TabLayoutItem* item = dynamic_cast( - layout->ItemAt(i)); - if (item && item->IsVisible() && item->Frame().Contains(where)) + TabLayoutItem* item = dynamic_cast(layout->ItemAt(i)); + if (item == NULL || !item->IsVisible()) + continue; + // Account for the fact that the tab frame does not contain the + // visible bottom border. + BRect frame = item->Frame(); + frame.bottom++; + if (frame.Contains(where)) return item->Parent(); } return NULL;