Changed COLOR8TOCOLOR16 to an inline function that simply returns (color8 << 8) | color8. This properly maps 0xFF to 0xFFFF, etc.

git-svn-id: svn://10.0.0.236/trunk@14726 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
beard%netscape.com 1998-11-15 21:56:40 +00:00
parent f9d7538c2b
commit 33bc4f922b

View File

@ -485,6 +485,11 @@ NS_IMETHODIMP nsWindow::Invalidate(PRBool aIsSynchronous)
return NS_OK;
}
inline PRUint16 COLOR8TOCOLOR16(PRUint8 color8)
{
// return (color8 == 0xFF ? 0xFFFF : (color8 << 8));
return (color8 << 8) | color8; /* (color8 * 257) == (color8 * 0x0101) */
}
//-------------------------------------------------------------------------
// StartDraw
@ -528,7 +533,6 @@ void nsWindow::StartDraw(nsIRenderingContext* aRenderingContext)
}
// set the background & foreground colors
#define COLOR8TOCOLOR16(color8) (color8 == 0xFF ? 0xFFFF : (color8 << 8))
nscolor color = GetBackgroundColor();
RGBColor macColor;
macColor.red = COLOR8TOCOLOR16(NS_GET_R(color));