Fix for GetNearestColor so it returns the true color rather than the

system palette if the device does not support a palette.
This commit is contained in:
Dave Hawkes 2002-02-05 19:44:07 +00:00 committed by Alexandre Julliard
parent 7904acf1bd
commit 314b9fdd63
1 changed files with 3 additions and 0 deletions

View File

@ -618,6 +618,9 @@ COLORREF WINAPI GetNearestColor(
DC *dc; DC *dc;
PALETTEOBJ *palObj; PALETTEOBJ *palObj;
if(!(GetDeviceCaps(hdc, RASTERCAPS) & RC_PALETTE)) {
return color;
}
if ( (dc = DC_GetDCPtr( hdc )) ) if ( (dc = DC_GetDCPtr( hdc )) )
{ {
HPALETTE hpal = (dc->hPalette)? dc->hPalette : GetStockObject( DEFAULT_PALETTE ); HPALETTE hpal = (dc->hPalette)? dc->hPalette : GetStockObject( DEFAULT_PALETTE );