Bug 1613375 - Always use reference frame origin offset in snapping transforms. r=nical
authorAndrew Osmond <aosmond@mozilla.com>
Wed, 05 Feb 2020 15:42:20 +0000
changeset 512590 a2ed78dab7bcf0cf5a0ff49606cafdd55b2f2fd9
parent 512589 f020ddf9062127a044ea3c026717e33e346ca8bc
child 512591 23091d9bdbcd200e1b535696a5f6d38b41889493
push id37093
push userdvarga@mozilla.com
push dateWed, 05 Feb 2020 21:50:17 +0000
treeherdermozilla-central@ee653474267a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnical
bugs1613375
milestone74.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1613375 - Always use reference frame origin offset in snapping transforms. r=nical We incorporate the reference frame origin offset for non-animated transforms, but forgot for animated transforms. Since the offset itself is not animated, we should still incorporate it into the snapping transform. Differential Revision: https://phabricator.services.mozilla.com/D61689
gfx/wr/webrender/src/spatial_node.rs
--- a/gfx/wr/webrender/src/spatial_node.rs
+++ b/gfx/wr/webrender/src/spatial_node.rs
@@ -694,18 +694,22 @@ impl SpatialNode {
                                 ScaleOffset::from_offset(origin_offset.to_untyped())
                                     .accumulate(&scale_offset)
                             }
                             None => return,
                         }
                     }
 
                     // Assume animations start at the identity transform for snapping purposes.
+                    // We still want to incorporate the reference frame offset however.
                     // TODO(aosmond): Is there a better known starting point?
-                    PropertyBinding::Binding(..) => ScaleOffset::identity(),
+                    PropertyBinding::Binding(..) => {
+                        let origin_offset = info.origin_in_parent_reference_frame;
+                        ScaleOffset::from_offset(origin_offset.to_untyped())
+                    }
                 }
             }
             _ => ScaleOffset::identity(),
         };
 
         self.snapping_transform = Some(parent_scale_offset.accumulate(&scale_offset));
     }