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

Unified Diff: cc/layers/scrollbar_layer_impl_base.cc

Issue 2803853007: Ignore rounding error between clip_layer_length_ and scroll_layer_length_ (Closed)
Patch Set: expose IsFloatNearlyTheSame & add comment Created 3 years, 8 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 | « cc/base/math_util_unittest.cc ('k') | cc/layers/scrollbar_layer_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/layers/scrollbar_layer_impl_base.cc
diff --git a/cc/layers/scrollbar_layer_impl_base.cc b/cc/layers/scrollbar_layer_impl_base.cc
index a4981e95b2d75cbe9bf891152c788b6ac1da2985..839c0b7f927d488f9ce76813ebd40b7abf66569f 100644
--- a/cc/layers/scrollbar_layer_impl_base.cc
+++ b/cc/layers/scrollbar_layer_impl_base.cc
@@ -66,7 +66,12 @@ bool ScrollbarLayerImplBase::CanScrollOrientation() const {
layer_tree_impl()->LayerByElementId(scroll_element_id_);
if (!scroll_layer)
return false;
+
return scroll_layer->user_scrollable(orientation()) &&
+ // Ensure clip_layer_length_ smaller than scroll_layer_length_ not
+ // caused by floating error.
+ !MathUtil::IsFloatNearlyTheSame(clip_layer_length_,
+ scroll_layer_length_) &&
clip_layer_length_ < scroll_layer_length_;
}
« no previous file with comments | « cc/base/math_util_unittest.cc ('k') | cc/layers/scrollbar_layer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698