From fd39708481b3785e58b608664a500fe1f6c96b21 Mon Sep 17 00:00:00 2001 From: "pavlov%netscape.com" Date: Sun, 14 Jan 2001 05:31:26 +0000 Subject: [PATCH] !@E!@#!@# git-svn-id: svn://10.0.0.236/trunk@84937 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/gfx2/public/nsPoint2.h | 10 +++++----- mozilla/gfx2/public/nsUnitConverters.h | 11 ++++++++--- mozilla/gfx2/src/windows/nsImage.cpp | 2 +- 3 files changed, 14 insertions(+), 9 deletions(-) diff --git a/mozilla/gfx2/public/nsPoint2.h b/mozilla/gfx2/public/nsPoint2.h index 6fa64cb71f6..e69716ce1b6 100644 --- a/mozilla/gfx2/public/nsPoint2.h +++ b/mozilla/gfx2/public/nsPoint2.h @@ -75,23 +75,23 @@ struct nsPoint2 { * @author Don Cone (3/29/00) * @version 0.0 */ -struct nsPathPoint: public nsPoint2{ +struct nsPathPoint2: public nsPoint2{ PRBool mIsOnCurve; // Constructors - nsPathPoint() {} - nsPathPoint(const nsPathPoint& aPoint) { + nsPathPoint2() {} + nsPathPoint2(const nsPathPoint2& aPoint) { x = aPoint.x; y = aPoint.y; mIsOnCurve = aPoint.mIsOnCurve; } - nsPathPoint(gfx_coord aX, gfx_coord aY) { + nsPathPoint2(gfx_coord aX, gfx_coord aY) { x = aX; y = aY; mIsOnCurve = PR_TRUE; } - nsPathPoint(gfx_coord aX, gfx_coord aY, PRBool aIsOnCurve) { + nsPathPoint2(gfx_coord aX, gfx_coord aY, PRBool aIsOnCurve) { x = aX; y = aY; mIsOnCurve = aIsOnCurve; diff --git a/mozilla/gfx2/public/nsUnitConverters.h b/mozilla/gfx2/public/nsUnitConverters.h index 597f2befa36..6e6f9d872ce 100644 --- a/mozilla/gfx2/public/nsUnitConverters.h +++ b/mozilla/gfx2/public/nsUnitConverters.h @@ -42,21 +42,26 @@ * @ingroup conversion_constants * @note XXX this should be derived from platform FLOAT_MIN */ -#define ROUND_EXCLUSIVE_CONST_FLOAT 0.4999999999999999 +#ifndef ROUND_EXCLUSIVE_CONST_FLOAT +#define ROUND_EXCLUSIVE_CONST_FLOAT 0.499999999 +#endif /** * ROUND_CONST_FLOAT * @ingroup conversion_constants */ +#ifndef ROUND_CONST_FLOAT #define ROUND_CONST_FLOAT 0.5 +#endif /** * CEIL_CONST_FLOAT * @ingroup conversion_constants * @note XXX this should be derived from platform FLOAT_MIN */ +#ifndef CEIL_CONST_FLOAT #define CEIL_CONST_FLOAT 0.99999999 - +#endif /** * gfx_coord rounding, floor, ceil functions @@ -72,7 +77,7 @@ */ inline gfx_coord GFXCoordAbs(gfx_coord aValue) { - return fabs(aValue); + return gfx_coord(fabs(aValue)); } diff --git a/mozilla/gfx2/src/windows/nsImage.cpp b/mozilla/gfx2/src/windows/nsImage.cpp index c9a1598dbc9..7f38ce4b302 100644 --- a/mozilla/gfx2/src/windows/nsImage.cpp +++ b/mozilla/gfx2/src/windows/nsImage.cpp @@ -214,7 +214,7 @@ NS_IMETHODIMP nsImage::GetFormat(gfx_format *aFormat) mBHead->biWidth = GFXCoordToIntCeil(mSize.width); mBHead->biHeight = -GFXCoordToIntCeil(mSize.height); mBHead->biPlanes = 1; - mBHead->biBitCount = 24; + mBHead->biBitCount = mDepth; mBHead->biCompression = BI_RGB; mBHead->biSizeImage = mBitsLength; // not compressed, so we dont need this to be set mBHead->biXPelsPerMeter = 0;