зеркало из https://github.com/mozilla/gecko-dev.git
Fix partial DOS line endings in nsRect.cpp, rs=khuey, no bug
--HG-- extra : rebase_source : 0bf86cf3015a3eecb19282159277581656136734
This commit is contained in:
Родитель
d1e7a921a4
Коммит
95cfe45230
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче