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

Unified Diff: third_party/WebKit/Source/core/layout/svg/LayoutSVGInlineText.cpp

Issue 2683233005: Set caret width based on device scale factor (Closed)
Patch Set: Fix compile error Created 3 years, 10 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
Index: third_party/WebKit/Source/core/layout/svg/LayoutSVGInlineText.cpp
diff --git a/third_party/WebKit/Source/core/layout/svg/LayoutSVGInlineText.cpp b/third_party/WebKit/Source/core/layout/svg/LayoutSVGInlineText.cpp
index f7f24a49b51b6e1e814aa8b6655e533cc4bbfb95..1ad386958c80cd23277a15ae7b4b89707da3b016 100644
--- a/third_party/WebKit/Source/core/layout/svg/LayoutSVGInlineText.cpp
+++ b/third_party/WebKit/Source/core/layout/svg/LayoutSVGInlineText.cpp
@@ -28,6 +28,7 @@
#include "core/dom/StyleEngine.h"
#include "core/editing/TextAffinity.h"
#include "core/editing/VisiblePosition.h"
+#include "core/frame/FrameView.h"
#include "core/layout/svg/LayoutSVGText.h"
#include "core/layout/svg/SVGLayoutSupport.h"
#include "core/layout/svg/line/SVGInlineTextBox.h"
@@ -111,12 +112,14 @@ LayoutRect LayoutSVGInlineText::localCaretRect(InlineBox* box,
if (static_cast<unsigned>(caretOffset) < textBox->start() + textBox->len()) {
LayoutRect rect = textBox->localSelectionRect(caretOffset, caretOffset + 1);
LayoutUnit x = box->isLeftToRightDirection() ? rect.x() : rect.maxX();
- return LayoutRect(x, rect.y(), caretWidth(), rect.height());
+ return LayoutRect(x, rect.y(), caretWidth(frameView()->getHostWindow()),
+ rect.height());
}
LayoutRect rect = textBox->localSelectionRect(caretOffset - 1, caretOffset);
LayoutUnit x = box->isLeftToRightDirection() ? rect.maxX() : rect.x();
- return LayoutRect(x, rect.y(), caretWidth(), rect.height());
+ return LayoutRect(x, rect.y(), caretWidth(frameView()->getHostWindow()),
+ rect.height());
}
FloatRect LayoutSVGInlineText::floatLinesBoundingBox() const {

Powered by Google App Engine
This is Rietveld 408576698