mirror of
https://github.com/reactos/reactos.git
synced 2024-12-26 17:14:41 +00:00
Added color translation for solid color brushes.
svn path=/trunk/; revision=3369
This commit is contained in:
parent
5add7bd9d8
commit
6b30cb44dd
2 changed files with 20 additions and 7 deletions
|
@ -13,7 +13,6 @@ BOOL VGADDIFillSolid(SURFOBJ *Surface, RECTL Dimensions, ULONG iColor)
|
|||
ULONG long leftpixs, midpixs, rightpixs, temp;
|
||||
UCHAR a;
|
||||
|
||||
DPRINT("VGADDIFillSolid: x:%d, y:%d, w:%d, h:%d\n", x, y, w, h);
|
||||
|
||||
// Swap dimensions so that x, y are at topmost left
|
||||
if(Dimensions.right < Dimensions.left) {
|
||||
|
@ -34,6 +33,7 @@ BOOL VGADDIFillSolid(SURFOBJ *Surface, RECTL Dimensions, ULONG iColor)
|
|||
// Calculate the width and height
|
||||
w = x2 - x;
|
||||
h = y2 - y;
|
||||
DPRINT("VGADDIFillSolid: x:%d, y:%d, w:%d, h:%d, color: %d\n", x, y, w, h, iColor);
|
||||
|
||||
// Calculate the starting offset
|
||||
offset = xconv[x]+y80[y];
|
||||
|
@ -86,7 +86,8 @@ BOOL VGADDIFillSolid(SURFOBJ *Surface, RECTL Dimensions, ULONG iColor)
|
|||
tmppre1+=80;
|
||||
}
|
||||
|
||||
// Middle
|
||||
// Middle
|
||||
|
||||
x=orgx+(8-leftpixs)+leftpixs;
|
||||
|
||||
} else {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $Id: dc.c,v 1.34 2002/08/18 07:02:57 ei Exp $
|
||||
/* $Id: dc.c,v 1.35 2002/08/19 21:49:45 ei Exp $
|
||||
*
|
||||
* DC.C - Device context functions
|
||||
*
|
||||
|
@ -904,6 +904,7 @@ HGDIOBJ STDCALL W32kSelectObject(HDC hDC, HGDIOBJ hGDIObj)
|
|||
PSURFGDI surfgdi;
|
||||
PDC dc;
|
||||
PPENOBJ pen;
|
||||
PBRUSHOBJ brush;
|
||||
PXLATEOBJ XlateObj;
|
||||
PPALGDI PalGDI;
|
||||
WORD objectMagic;
|
||||
|
@ -923,14 +924,25 @@ HGDIOBJ STDCALL W32kSelectObject(HDC hDC, HGDIOBJ hGDIObj)
|
|||
|
||||
// Convert the color of the pen to the format of the DC
|
||||
PalGDI = (PPALGDI)AccessInternalObject(dc->w.hPalette);
|
||||
XlateObj = (PXLATEOBJ)EngCreateXlate(PalGDI->Mode, PAL_RGB, dc->w.hPalette, NULL);
|
||||
pen = GDIOBJ_LockObj(dc->w.hPen, GO_PEN_MAGIC);
|
||||
pen->logpen.lopnColor = XLATEOBJ_iXlate(XlateObj, pen->logpen.lopnColor);
|
||||
GDIOBJ_UnlockObj( dc->w.hPen, GO_PEN_MAGIC);
|
||||
if( PalGDI ){
|
||||
XlateObj = (PXLATEOBJ)EngCreateXlate(PalGDI->Mode, PAL_RGB, dc->w.hPalette, NULL);
|
||||
pen = GDIOBJ_LockObj(dc->w.hPen, GO_PEN_MAGIC);
|
||||
pen->logpen.lopnColor = XLATEOBJ_iXlate(XlateObj, pen->logpen.lopnColor);
|
||||
GDIOBJ_UnlockObj( dc->w.hPen, GO_PEN_MAGIC);
|
||||
}
|
||||
break;
|
||||
case GO_BRUSH_MAGIC:
|
||||
objOrg = (HGDIOBJ)dc->w.hBrush;
|
||||
dc->w.hBrush = (HBRUSH) hGDIObj;
|
||||
|
||||
// Convert the color of the brush to the format of the DC
|
||||
PalGDI = (PPALGDI)AccessInternalObject(dc->w.hPalette);
|
||||
if( PalGDI ){
|
||||
XlateObj = (PXLATEOBJ)EngCreateXlate(PalGDI->Mode, PAL_RGB, dc->w.hPalette, NULL);
|
||||
brush = GDIOBJ_LockObj(dc->w.hBrush, GO_BRUSH_MAGIC);
|
||||
brush->iSolidColor = XLATEOBJ_iXlate(XlateObj, brush->iSolidColor);
|
||||
GDIOBJ_UnlockObj( dc->w.hBrush, GO_BRUSH_MAGIC);
|
||||
}
|
||||
break;
|
||||
case GO_FONT_MAGIC:
|
||||
objOrg = (HGDIOBJ)dc->w.hFont;
|
||||
|
|
Loading…
Reference in a new issue