From 1d2d23191b03e61911eb3033fad64abe7a6ca8a5 Mon Sep 17 00:00:00 2001 From: Xidorn Quan Date: Fri, 24 Apr 2015 10:15:32 +1200 Subject: [PATCH] Bug 1117227 part 1 - Add IntersectRect method to LogicalRect. r=jfkthame --HG-- extra : source : 3c42cbab1f5087c5411984c69b2f06939b735e93 --- layout/generic/WritingModes.h | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/layout/generic/WritingModes.h b/layout/generic/WritingModes.h index adafba9f675e..c4d817693d68 100644 --- a/layout/generic/WritingModes.h +++ b/layout/generic/WritingModes.h @@ -1731,6 +1731,17 @@ public: aContainerWidth); } + /** + * Set *this to be the rectangle containing the intersection of aRect1 + * and aRect2, return whether the intersection is non-empty. + */ + bool IntersectRect(const LogicalRect& aRect1, const LogicalRect& aRect2) + { + CHECK_WRITING_MODE(aRect1.mWritingMode); + CHECK_WRITING_MODE(aRect2.mWritingMode); + return mRect.IntersectRect(aRect1.mRect, aRect2.mRect); + } + private: LogicalRect() = delete;