Bug 1258313 - Allow snapping of 'pseudo' 3d transforms. r=jrmuizel
authorMatt Woodrow <mwoodrow@mozilla.com>
Wed, 06 Apr 2016 15:29:32 +1200
changeset 291855 482a89ef31e86ca70581b8736a21e9c601f133c0
parent 291854 5d456db9e320022548bf0a90b8b7d6196cae24fc
child 291856 cc6c0df12548c251921f7e94f577d7a77a080ad2
push idunknown
push userunknown
push dateunknown
reviewersjrmuizel
bugs1258313
milestone48.0a1
Bug 1258313 - Allow snapping of 'pseudo' 3d transforms. r=jrmuizel
gfx/layers/Layers.cpp
--- a/gfx/layers/Layers.cpp
+++ b/gfx/layers/Layers.cpp
@@ -621,17 +621,17 @@ Layer::SnapTransformTranslation(const Ma
   }
 
   if (!mManager->IsSnappingEffectiveTransforms()) {
     return aTransform;
   }
 
   Matrix matrix2D;
   Matrix4x4 result;
-  if (aTransform.Is2D(&matrix2D) &&
+  if (aTransform.CanDraw2D(&matrix2D) &&
       !matrix2D.HasNonTranslation() &&
       matrix2D.HasNonIntegerTranslation()) {
     IntPoint snappedTranslation = RoundedToInt(matrix2D.GetTranslation());
     Matrix snappedMatrix = Matrix::Translation(snappedTranslation.x,
                                                snappedTranslation.y);
     result = Matrix4x4::From2D(snappedMatrix);
     if (aResidualTransform) {
       // set aResidualTransform so that aResidual * snappedMatrix == matrix2D.