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

Unified Diff: chrome/browser/ui/cocoa/location_bar/autocomplete_text_field_editor.mm

Issue 2560993002: [Mac] Fix omnibox text overlap (Closed)
Patch Set: Created 4 years 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 | « chrome/browser/ui/cocoa/location_bar/autocomplete_text_field_cell.mm ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/cocoa/location_bar/autocomplete_text_field_editor.mm
diff --git a/chrome/browser/ui/cocoa/location_bar/autocomplete_text_field_editor.mm b/chrome/browser/ui/cocoa/location_bar/autocomplete_text_field_editor.mm
index a8214d4425604dbd530206f7bfb07b08325878c4..0021b4012629064171bdc9f0a250cb172dc13c0b 100644
--- a/chrome/browser/ui/cocoa/location_bar/autocomplete_text_field_editor.mm
+++ b/chrome/browser/ui/cocoa/location_bar/autocomplete_text_field_editor.mm
@@ -39,6 +39,9 @@ bool gInDrag = false;
// so this is conservative.
const NSUInteger kMaxPasteLength = 10000;
+// How much the text should be offset from its left.
+const CGFloat kTextXOffset = -1.0;
+
// Returns |YES| if too much text would be pasted.
BOOL ThePasteboardIsTooDamnBig() {
NSPasteboard* pb = [NSPasteboard generalPasteboard];
@@ -599,9 +602,15 @@ NSMenuItem* PasteAndGoMenuItemForObserver(
}
- (void)drawRect:(NSRect)rect {
+ gfx::ScopedNSGraphicsContextSaveGState saveGraphicsState;
AutocompleteTextFieldObserver* observer = [self observer];
if (observer)
observer->OnBeforeDrawRect();
+
+ NSAffineTransform* transform = [NSAffineTransform transform];
+ [transform translateXBy:kTextXOffset yBy:0];
+ [transform concat];
+
[super drawRect:rect];
if (observer)
observer->OnDidDrawRect();
« no previous file with comments | « chrome/browser/ui/cocoa/location_bar/autocomplete_text_field_cell.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698