winex11: Correctly handle non-RGB COLORREFs in BRUSH_SelectSolidBrush.

This commit is contained in:
Vladimir Panteleev 2010-11-07 04:38:02 +02:00 committed by Alexandre Julliard
parent d7d5fb0abf
commit 208aeedcda
1 changed files with 4 additions and 3 deletions

View File

@ -183,17 +183,18 @@ static Pixmap BRUSH_DitherMono( COLORREF color )
*/ */
static void BRUSH_SelectSolidBrush( X11DRV_PDEVICE *physDev, COLORREF color ) static void BRUSH_SelectSolidBrush( X11DRV_PDEVICE *physDev, COLORREF color )
{ {
COLORREF colorRGB = X11DRV_PALETTE_GetColor( physDev, color );
if ((physDev->depth > 1) && (screen_depth <= 8) && !X11DRV_IsSolidColor( color )) if ((physDev->depth > 1) && (screen_depth <= 8) && !X11DRV_IsSolidColor( color ))
{ {
/* Dithered brush */ /* Dithered brush */
physDev->brush.pixmap = BRUSH_DitherColor( color, physDev->depth ); physDev->brush.pixmap = BRUSH_DitherColor( colorRGB, physDev->depth );
physDev->brush.fillStyle = FillTiled; physDev->brush.fillStyle = FillTiled;
physDev->brush.pixel = 0; physDev->brush.pixel = 0;
} }
else if (physDev->depth == 1 && color != WHITE && color != BLACK) else if (physDev->depth == 1 && colorRGB != WHITE && colorRGB != BLACK)
{ {
physDev->brush.pixel = 0; physDev->brush.pixel = 0;
physDev->brush.pixmap = BRUSH_DitherMono( color ); physDev->brush.pixmap = BRUSH_DitherMono( colorRGB );
physDev->brush.fillStyle = FillTiled; physDev->brush.fillStyle = FillTiled;
} }
else else