Commit b15936e4 authored by Morris Tseng's avatar Morris Tseng
Browse files

Bug 1399050 - Apply inherited scale on 3d transform as well. r=kats

MozReview-Commit-ID: 8F1d4NzVcam
parent afa14cd3
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -92,16 +92,16 @@ StackingContextHelper::StackingContextHelper(const StackingContextHelper& aParen
    mTransform = *aTransformPtr;
  }

  // Apply the inherited scale from parent
  mTransform.PostScale(aParentSC.mXScale, aParentSC.mYScale, 1.0);
  mTransform.NudgeToIntegersFixedEpsilon();

  bool is2d = !aTransformPtr || (aTransformPtr->Is2D() && !aPerspectivePtr);
  if (is2d) {
    nsRect itemBounds = aDisplayList->GetClippedBoundsWithRespectToASR(aDisplayListBuilder, aItem->GetActiveScrolledRoot());
    nsRect childrenVisible = aItem->GetVisibleRectForChildren();
    visibleRect = itemBounds.Intersect(childrenVisible);

    // Apply the inherited scale from parent
    mTransform.PostScale(aParentSC.mXScale, aParentSC.mYScale, 1.0);
    mTransform.NudgeToIntegersFixedEpsilon();

    gfx::Size scale = mTransform.As2D().ScaleFactors(true);

    // Restore the scale to default if the scale is too small