Bug 499377 addendum - Complete nsMargin arithmetic for nsRect r=roc

This commit is contained in:
fantasai 2009-07-14 22:20:32 -07:00
Родитель 1816bcdd46
Коммит bcc6e7c37a
1 изменённых файлов: 5 добавлений и 4 удалений

Просмотреть файл

@ -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