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

Unified Diff: Source/core/frame/FrameView.cpp

Issue 200023002: Making LayoutUnit conversions to Float type explicit (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 9 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: Source/core/frame/FrameView.cpp
diff --git a/Source/core/frame/FrameView.cpp b/Source/core/frame/FrameView.cpp
index 99b2e7368871438fa3af58c19e8cf1e0cb84e63c..ad37f4bfb40e6f4d42d3b6c01d7e637d78d8e6b5 100644
--- a/Source/core/frame/FrameView.cpp
+++ b/Source/core/frame/FrameView.cpp
@@ -2865,8 +2865,8 @@ void FrameView::forceLayoutForPagination(const FloatSize& pageSize, const FloatS
const LayoutRect& documentRect = renderView->documentRect();
LayoutUnit docLogicalWidth = horizontalWritingMode ? documentRect.width() : documentRect.height();
if (docLogicalWidth > pageLogicalWidth) {
- int expectedPageWidth = std::min<float>(documentRect.width(), pageSize.width() * maximumShrinkFactor);
- int expectedPageHeight = std::min<float>(documentRect.height(), pageSize.height() * maximumShrinkFactor);
+ int expectedPageWidth = std::min<float>(documentRect.width().toFloat(), pageSize.width() * maximumShrinkFactor);
leviw_travelin_and_unemployed 2014/03/14 18:25:26 It seems wrong not to call .toInt() on the LayoutU
gnana 2014/03/18 14:20:18 Made it float, because resizePageRectsKeepingRatio
+ int expectedPageHeight = std::min<float>(documentRect.height().toFloat(), pageSize.height() * maximumShrinkFactor);
FloatSize maxPageSize = m_frame->resizePageRectsKeepingRatio(FloatSize(originalPageSize.width(), originalPageSize.height()), FloatSize(expectedPageWidth, expectedPageHeight));
pageLogicalWidth = horizontalWritingMode ? maxPageSize.width() : maxPageSize.height();
pageLogicalHeight = horizontalWritingMode ? maxPageSize.height() : maxPageSize.width();

Powered by Google App Engine
This is Rietveld 408576698