Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1186)

Unified Diff: chrome/browser/cocoa/tab_view.mm

Issue 99225: Changes the way we calculate hit rects in TabView to reduce... (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: '' Created 11 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/cocoa/tab_view.mm
===================================================================
--- chrome/browser/cocoa/tab_view.mm (revision 14943)
+++ chrome/browser/cocoa/tab_view.mm (working copy)
@@ -32,8 +32,16 @@
// view or our child close button.
- (NSView *)hitTest:(NSPoint)aPoint {
NSPoint viewPoint = [self convertPoint:aPoint fromView:[self superview]];
+ NSRect frame = [self frame];
+
+ // Reduce the width of the hit rect slightly to remove the overlap
+ // between adjacent tabs. The drawing code in TabCell has the top
+ // corners of the tab inset by height*2/3, so we inset by half of
+ // that here. This doesn't completely eliminate the overlap, but it
+ // works well enough.
+ NSRect hitRect = NSInsetRect(frame, frame.size.height / 3.0f, 0);
if (NSPointInRect(viewPoint, [closeButton_ frame])) return closeButton_;
- if (NSPointInRect(aPoint, [self frame])) return self;
+ if (NSPointInRect(aPoint, hitRect)) return self;
return nil;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698