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

Unified Diff: third_party/WebKit/Source/core/paint/FileUploadControlPainter.cpp

Issue 1651703002: More explicit LayoutUnit conversions (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@evenMoarConstructors
Patch Set: Traits vs Properties vs Pandas Created 4 years, 11 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/paint/FileUploadControlPainter.cpp
diff --git a/third_party/WebKit/Source/core/paint/FileUploadControlPainter.cpp b/third_party/WebKit/Source/core/paint/FileUploadControlPainter.cpp
index 97a0f73e4c6342b03d80f3169406165c821e4bfa..7d429f81133b395ba37d8ddc18c99c224a73eedb 100644
--- a/third_party/WebKit/Source/core/paint/FileUploadControlPainter.cpp
+++ b/third_party/WebKit/Source/core/paint/FileUploadControlPainter.cpp
@@ -45,7 +45,7 @@ void FileUploadControlPainter::paintObject(const PaintInfo& paintInfo, const Lay
return;
int buttonWidth = (button && button->layoutBox()) ? button->layoutBox()->pixelSnappedWidth() : 0;
- LayoutUnit buttonAndSpacingWidth = buttonWidth + LayoutFileUploadControl::afterButtonSpacing;
+ LayoutUnit buttonAndSpacingWidth(buttonWidth + LayoutFileUploadControl::afterButtonSpacing);
float textWidth = font.width(textRun);
LayoutUnit textX;
if (m_layoutFileUploadControl.style()->isLeftToRightDirection())
@@ -59,7 +59,7 @@ void FileUploadControlPainter::paintObject(const PaintInfo& paintInfo, const Lay
if (LayoutButton* buttonLayoutObject = toLayoutButton(button->layoutObject()))
textY = paintOffset.y() + m_layoutFileUploadControl.borderTop() + m_layoutFileUploadControl.paddingTop() + buttonLayoutObject->baselinePosition(AlphabeticBaseline, true, HorizontalLine, PositionOnContainingLine);
else
- textY = m_layoutFileUploadControl.baselinePosition(AlphabeticBaseline, true, HorizontalLine, PositionOnContainingLine);
+ textY = LayoutUnit(m_layoutFileUploadControl.baselinePosition(AlphabeticBaseline, true, HorizontalLine, PositionOnContainingLine));
TextRunPaintInfo textRunPaintInfo(textRun);
// FIXME: Shouldn't these offsets be rounded? crbug.com/350474
textRunPaintInfo.bounds = FloatRect(textX.toFloat(), textY.toFloat() - m_layoutFileUploadControl.style()->fontMetrics().ascent(),
« no previous file with comments | « third_party/WebKit/Source/core/page/SpatialNavigation.cpp ('k') | third_party/WebKit/Source/core/paint/FrameSetPainter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698