Fix partial DOS line endings in nsRect.cpp, rs=khuey, no bug

--HG--
extra : rebase_source : 0bf86cf3015a3eecb19282159277581656136734
This commit is contained in:
Zack Weinberg 2011-04-13 10:16:36 -07:00
Родитель d1e7a921a4
Коммит 95cfe45230
1 изменённых файлов: 11 добавлений и 12 удалений

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

@ -217,7 +217,7 @@ nsRect& nsRect::ExtendForScaling(float aXMult, float aYMult)
NS_ASSERTION((IsFloatInteger(aXMult) || IsFloatInteger(1/aXMult)) &&
(IsFloatInteger(aYMult) || IsFloatInteger(1/aYMult)),
"Multiplication factors must be integers or 1/integer");
// Scale rect by multiplier, snap outwards to integers and then unscale.
// We round the results to the nearest integer to prevent floating point errors.
if (aXMult < 1) {
@ -330,15 +330,14 @@ PRBool nsIntRect::UnionRect(const nsIntRect &aRect1, const nsIntRect &aRect2)
return result;
}
// scale the rect but round to smallest containing rect
nsIntRect& nsIntRect::ScaleRoundOut(float aXScale, float aYScale)
{
nscoord right = NSToCoordCeil(float(XMost()) * aXScale);
nscoord bottom = NSToCoordCeil(float(YMost()) * aYScale);
x = NSToCoordFloor(float(x) * aXScale);
y = NSToCoordFloor(float(y) * aYScale);
width = (right - x);
height = (bottom - y);
return *this;
// scale the rect but round to smallest containing rect
nsIntRect& nsIntRect::ScaleRoundOut(float aXScale, float aYScale)
{
nscoord right = NSToCoordCeil(float(XMost()) * aXScale);
nscoord bottom = NSToCoordCeil(float(YMost()) * aYScale);
x = NSToCoordFloor(float(x) * aXScale);
y = NSToCoordFloor(float(y) * aYScale);
width = (right - x);
height = (bottom - y);
return *this;
}