diff --git a/gfx/2d/Matrix.h b/gfx/2d/Matrix.h index c9e8ef67b2ee..632b7583ae26 100644 --- a/gfx/2d/Matrix.h +++ b/gfx/2d/Matrix.h @@ -1907,7 +1907,9 @@ public: const RectTyped& aClip) const { if (mType == MatrixType::Identity) { - return aRect; + const RectTyped& clipped = aRect.Intersect(aClip); + return RectTyped(clipped.X(), clipped.Y(), + clipped.Width(), clipped.Height()); } if (mType == MatrixType::Simple) {