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

Unified Diff: cc/trees/property_tree.cc

Issue 2432043007: Include scroll snap in scroll position used for sticky offset calculation. (Closed)
Patch Set: Include scroll snap in scroll position used for sticky offset. Created 4 years, 2 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/trees/layer_tree_host_common_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/trees/property_tree.cc
diff --git a/cc/trees/property_tree.cc b/cc/trees/property_tree.cc
index 500f6ec7580f58b2ffa128c55177bd000f9cc40d..19f131f899dbbf11f0e440c95348c923d079f1fa 100644
--- a/cc/trees/property_tree.cc
+++ b/cc/trees/property_tree.cc
@@ -424,9 +424,15 @@ gfx::Vector2dF StickyPositionOffset(TransformTree* tree, TransformNode* node) {
gfx::ScrollOffset scroll_offset =
tree->property_trees()->scroll_tree.current_scroll_offset(
scroll_node->owner_id);
+ gfx::PointF scroll_position(scroll_offset.x(), scroll_offset.y());
+ // The scroll position does not include snapping which shifts the scroll
+ // offset to align to a pixel boundary, we need to manually include it here.
+ scroll_position -= tree->property_trees()
+ ->transform_tree.Node(scroll_node->transform_id)
+ ->scroll_snap;
gfx::RectF clip(
- gfx::PointF(scroll_offset.x(), scroll_offset.y()),
+ scroll_position,
gfx::SizeF(tree->property_trees()->scroll_tree.scroll_clip_layer_bounds(
scroll_node->id)));
gfx::Vector2dF sticky_offset(
« no previous file with comments | « cc/trees/layer_tree_host_common_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698