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

Unified Diff: Source/web/WebViewImpl.cpp

Issue 1071383002: Round when calculating minimum height of WebViews (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Added test that rounds down Created 5 years, 7 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 | « no previous file | Source/web/tests/WebViewTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/web/WebViewImpl.cpp
diff --git a/Source/web/WebViewImpl.cpp b/Source/web/WebViewImpl.cpp
index f93bb2df4bc70da71d10bbdfd2806fc381f83770..34842696ed23487ca4fb3a68b6732b3f98cf70dd 100644
--- a/Source/web/WebViewImpl.cpp
+++ b/Source/web/WebViewImpl.cpp
@@ -3379,7 +3379,7 @@ WebSize WebViewImpl::contentsPreferredMinimumSize()
layout();
int widthScaled = document->layoutView()->minPreferredLogicalWidth().round(); // Already accounts for zoom.
- int heightScaled = static_cast<int>(document->documentElement()->scrollHeight() * zoomLevelToZoomFactor(zoomLevel()));
+ int heightScaled = static_cast<int>((document->documentElement()->scrollHeight() * zoomLevelToZoomFactor(zoomLevel())) + 0.5); // +0.5 to round rather than truncating
return IntSize(widthScaled, heightScaled);
}
« no previous file with comments | « no previous file | Source/web/tests/WebViewTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698