mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-14 22:05:44 +00:00
Bug 499377 addendum - Complete nsMargin arithmetic for nsRect r=roc
This commit is contained in:
parent
1816bcdd46
commit
bcc6e7c37a
@ -172,10 +172,11 @@ struct NS_GFX nsRect {
|
||||
nsRect& operator-=(const nsPoint& aPoint) {x -= aPoint.x; y -= aPoint.y; return *this;}
|
||||
|
||||
// Arithmetic with nsMargins
|
||||
/**
|
||||
* Return nsMargin m such that if m = rectA - rectB, rectB.Inflate(m) == rectA
|
||||
*/
|
||||
nsMargin operator-(const nsRect& aRect) const;
|
||||
nsMargin operator-(const nsRect& aRect) const; // Find difference as nsMargin
|
||||
nsRect& operator+=(const nsMargin& aMargin) { Inflate(aMargin); return *this; }
|
||||
nsRect& operator-=(const nsMargin& aMargin) { Deflate(aMargin); return *this; }
|
||||
nsRect operator+(const nsMargin& aMargin) const { return nsRect(*this) += aMargin; }
|
||||
nsRect operator-(const nsMargin& aMargin) const { return nsRect(*this) -= aMargin; }
|
||||
|
||||
// Scale by aScale, converting coordinates to integers so that the result
|
||||
// is the smallest integer-coordinate rectangle containing the unrounded result
|
||||
|
Loading…
Reference in New Issue
Block a user