From c9202e29336398a057016a2e3d2d58d68207ac20 Mon Sep 17 00:00:00 2001 From: Miko Mynttinen Date: Fri, 20 Jul 2018 17:28:37 +0200 Subject: [PATCH] Bug 1477260 - Clip the rect in Matrix4x4TypedFlagged::TransformAndClipBounds, when transform is an identity matrix r=bas MozReview-Commit-ID: 3a8vnl3K87n --HG-- extra : rebase_source : b4bdd2b14e10becee20007e453497e9d7a204097 --- gfx/2d/Matrix.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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) {