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

Unified Diff: Source/core/layout/line/InlineTextBox.cpp

Issue 1228633002: Remove unnecessary LayoutUnit -> float -> LayoutUnit conversions. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 5 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 | « Source/core/layout/line/InlineFlowBox.cpp ('k') | Source/core/layout/line/RootInlineBox.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/layout/line/InlineTextBox.cpp
diff --git a/Source/core/layout/line/InlineTextBox.cpp b/Source/core/layout/line/InlineTextBox.cpp
index a57571c4d00d022d8494ff50ec2932f9bedf557e..9ca290d77688815bfbefba3d0f8c5a8f5144b59f 100644
--- a/Source/core/layout/line/InlineTextBox.cpp
+++ b/Source/core/layout/line/InlineTextBox.cpp
@@ -204,14 +204,14 @@ LayoutRect InlineTextBox::localSelectionRect(int startPos, int endPos)
bool respectHyphen = ePos == m_len && hasHyphen();
TextRun textRun = constructTextRun(styleToUse, font, respectHyphen ? &charactersWithHyphen : 0);
- LayoutPoint startingPoint = LayoutPoint(logicalLeft(), selTop.toFloat());
+ LayoutPoint startingPoint = LayoutPoint(logicalLeft(), selTop);
LayoutRect r;
if (sPos || ePos != static_cast<int>(m_len)) {
r = LayoutRect(enclosingIntRect(font.selectionRectForText(textRun, FloatPoint(startingPoint), selHeight, sPos, ePos)));
} else { // Avoid computing the font width when the entire line box is selected as an optimization.
// FIXME: the call to rawValue() below is temporary and should be removed once the transition
// to LayoutUnit-based types is complete (crbug.com/321237)
- r = LayoutRect(enclosingIntRect(LayoutRect(startingPoint, LayoutSize(m_logicalWidth, selHeight.toFloat()))));
+ r = LayoutRect(enclosingIntRect(LayoutRect(startingPoint, LayoutSize(m_logicalWidth, selHeight))));
}
LayoutUnit logicalWidth = r.width();
« no previous file with comments | « Source/core/layout/line/InlineFlowBox.cpp ('k') | Source/core/layout/line/RootInlineBox.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698