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

Unified Diff: third_party/WebKit/Source/core/editing/CaretBase.cpp

Issue 2310173002: Paint carets at pixel-snapped positions. (Closed)
Patch Set: none Created 4 years, 3 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 | « third_party/WebKit/LayoutTests/paint/caret/caret-subpixel-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/editing/CaretBase.cpp
diff --git a/third_party/WebKit/Source/core/editing/CaretBase.cpp b/third_party/WebKit/Source/core/editing/CaretBase.cpp
index 9a470a0b2d67df7b23184f4bfa7a0ff9bde3fa97..2396208471db959434750bfd532e3f8944d04fc4 100644
--- a/third_party/WebKit/Source/core/editing/CaretBase.cpp
+++ b/third_party/WebKit/Source/core/editing/CaretBase.cpp
@@ -217,9 +217,9 @@ void CaretBase::paintCaret(Node* node, GraphicsContext& context, const LayoutPoi
if (element && element->layoutObject())
caretColor = element->layoutObject()->resolveColor(CSSPropertyColor);
- DrawingRecorder drawingRecorder(context, *this, DisplayItem::kCaret, FloatRect(drawingRect));
-
- context.fillRect(FloatRect(drawingRect), caretColor);
+ IntRect paintRect = pixelSnappedIntRect(drawingRect);
+ DrawingRecorder drawingRecorder(context, *this, DisplayItem::kCaret, paintRect);
+ context.fillRect(paintRect, caretColor);
}
void CaretBase::setCaretVisibility(CaretVisibility visibility)
« no previous file with comments | « third_party/WebKit/LayoutTests/paint/caret/caret-subpixel-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698