Make scaled_scroll_bounds floaat to avoid truncating intermediate results.

Minor refactor to avoid the possibility of accumulating error through
truncation in LayerImpl::MaxScrollOffset().

Review URL: https://codereview.chromium.org/214893005

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@260113 0039d316-1c4b-4281-b951-d872f2087c98
parent 571f91c0
...@@ -1156,7 +1156,7 @@ gfx::Vector2d LayerImpl::MaxScrollOffset() const { ...@@ -1156,7 +1156,7 @@ gfx::Vector2d LayerImpl::MaxScrollOffset() const {
DCHECK(this != layer_tree_impl()->InnerViewportScrollLayer() || DCHECK(this != layer_tree_impl()->InnerViewportScrollLayer() ||
IsContainerForFixedPositionLayers()); IsContainerForFixedPositionLayers());
gfx::Size scaled_scroll_bounds(bounds()); gfx::SizeF scaled_scroll_bounds(bounds());
float scale_factor = 1.f; float scale_factor = 1.f;
for (LayerImpl const* current_layer = this; for (LayerImpl const* current_layer = this;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment