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:
parent
7904acf1bd
commit
314b9fdd63
|
@ -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 );
|
||||||
|
|
Loading…
Reference in New Issue