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

Unified Diff: third_party/WebKit/Source/core/layout/LayoutSliderContainer.cpp

Issue 1656743002: Removing more implicit LayoutUnit construction (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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/layout/LayoutSliderContainer.cpp
diff --git a/third_party/WebKit/Source/core/layout/LayoutSliderContainer.cpp b/third_party/WebKit/Source/core/layout/LayoutSliderContainer.cpp
index b117fc1fd65bf853394035f6470a6b4482ed5cad..f07ea44a177efefcfb72313c66132ca3666e96fe 100644
--- a/third_party/WebKit/Source/core/layout/LayoutSliderContainer.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutSliderContainer.cpp
@@ -71,10 +71,10 @@ void LayoutSliderContainer::computeLogicalHeight(LayoutUnit logicalHeight, Layou
int offsetFromCenter = LayoutTheme::theme().sliderTickOffsetFromTrackCenter();
LayoutUnit trackHeight;
if (offsetFromCenter < 0) {
- trackHeight = -2 * offsetFromCenter;
+ trackHeight = LayoutUnit(-2 * offsetFromCenter);
} else {
int tickLength = LayoutTheme::theme().sliderTickSize().height();
- trackHeight = 2 * (offsetFromCenter + tickLength);
+ trackHeight = LayoutUnit(2 * (offsetFromCenter + tickLength));
}
float zoomFactor = style()->effectiveZoom();
if (zoomFactor != 1.0)
@@ -87,7 +87,7 @@ void LayoutSliderContainer::computeLogicalHeight(LayoutUnit logicalHeight, Layou
return;
}
if (isVertical)
- logicalHeight = LayoutSlider::defaultTrackLength;
+ logicalHeight = LayoutUnit(LayoutSlider::defaultTrackLength);
// FIXME: The trackHeight should have been added before updateLogicalHeight was called to avoid this hack.
setIntrinsicContentLogicalHeight(logicalHeight);
@@ -129,7 +129,7 @@ void LayoutSliderContainer::layout()
double percentageOffset = sliderPosition(input).toDouble();
LayoutUnit availableExtent = isVertical ? track->contentHeight() : track->contentWidth();
availableExtent -= isVertical ? thumb->size().height() : thumb->size().width();
- LayoutUnit offset = percentageOffset * availableExtent;
+ LayoutUnit offset(percentageOffset * availableExtent);
LayoutPoint thumbLocation = thumb->location();
if (isVertical)
thumbLocation.setY(thumbLocation.y() + track->contentHeight() - thumb->size().height() - offset);

Powered by Google App Engine
This is Rietveld 408576698