gdi32: Store text alignment in DC_ATTR.
Signed-off-by: Jacek Caban <jacek@codeweavers.com> Signed-off-by: Huw Davies <huw@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
607733af0e
commit
aca66fb503
|
@ -94,7 +94,7 @@ static void set_initial_dc_state( DC *dc )
|
|||
dc->brush_org.x = 0;
|
||||
dc->brush_org.y = 0;
|
||||
dc->mapperFlags = 0;
|
||||
dc->textAlign = TA_LEFT | TA_TOP | TA_NOUPDATECP;
|
||||
dc->attr->text_align = TA_LEFT | TA_TOP | TA_NOUPDATECP;
|
||||
dc->charExtra = 0;
|
||||
dc->breakExtra = 0;
|
||||
dc->breakRem = 0;
|
||||
|
@ -409,7 +409,7 @@ INT CDECL nulldrv_SaveDC( PHYSDEV dev )
|
|||
newdc->dcPenColor = dc->dcPenColor;
|
||||
newdc->brush_org = dc->brush_org;
|
||||
newdc->mapperFlags = dc->mapperFlags;
|
||||
newdc->textAlign = dc->textAlign;
|
||||
newdc->attr->text_align = dc->attr->text_align;
|
||||
newdc->charExtra = dc->charExtra;
|
||||
newdc->breakExtra = dc->breakExtra;
|
||||
newdc->breakRem = dc->breakRem;
|
||||
|
@ -486,7 +486,7 @@ BOOL CDECL nulldrv_RestoreDC( PHYSDEV dev, INT level )
|
|||
dc->dcPenColor = dcs->dcPenColor;
|
||||
dc->brush_org = dcs->brush_org;
|
||||
dc->mapperFlags = dcs->mapperFlags;
|
||||
dc->textAlign = dcs->textAlign;
|
||||
dc->attr->text_align = dcs->attr->text_align;
|
||||
dc->charExtra = dcs->charExtra;
|
||||
dc->breakExtra = dcs->breakExtra;
|
||||
dc->breakRem = dcs->breakRem;
|
||||
|
@ -988,22 +988,6 @@ COLORREF WINAPI SetTextColor( HDC hdc, COLORREF color )
|
|||
}
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
* GetTextAlign (GDI32.@)
|
||||
*/
|
||||
UINT WINAPI GetTextAlign( HDC hdc )
|
||||
{
|
||||
UINT ret = 0;
|
||||
DC * dc = get_dc_ptr( hdc );
|
||||
if (dc)
|
||||
{
|
||||
ret = dc->textAlign;
|
||||
release_dc_ptr( dc );
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
* SetTextAlign (GDI32.@)
|
||||
*/
|
||||
|
@ -1020,8 +1004,8 @@ UINT WINAPI SetTextAlign( HDC hdc, UINT align )
|
|||
align = physdev->funcs->pSetTextAlign( physdev, align );
|
||||
if (align != GDI_ERROR)
|
||||
{
|
||||
ret = dc->textAlign;
|
||||
dc->textAlign = align;
|
||||
ret = dc->attr->text_align;
|
||||
dc->attr->text_align = align;
|
||||
}
|
||||
release_dc_ptr( dc );
|
||||
}
|
||||
|
|
|
@ -936,7 +936,7 @@ BOOL CDECL EMFDRV_ExtTextOut( PHYSDEV dev, INT x, INT y, UINT flags, const RECT
|
|||
BOOL ret;
|
||||
int textHeight = 0;
|
||||
int textWidth = 0;
|
||||
const UINT textAlign = dc->textAlign;
|
||||
const UINT textAlign = dc->attr->text_align;
|
||||
const INT graphicsMode = dc->attr->graphics_mode;
|
||||
FLOAT exScale, eyScale;
|
||||
|
||||
|
|
|
@ -5949,7 +5949,7 @@ BOOL WINAPI ExtTextOutW( HDC hdc, INT x, INT y, UINT flags,
|
|||
if (!dc) return FALSE;
|
||||
if (count > INT_MAX) return FALSE;
|
||||
|
||||
align = dc->textAlign;
|
||||
align = dc->attr->text_align;
|
||||
breakRem = dc->breakRem;
|
||||
layout = dc->layout;
|
||||
|
||||
|
|
|
@ -37,6 +37,15 @@ static DC_ATTR *get_dc_attr( HDC hdc )
|
|||
return dc_attr;
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* GetTextAlign (GDI32.@)
|
||||
*/
|
||||
UINT WINAPI GetTextAlign( HDC hdc )
|
||||
{
|
||||
DC_ATTR *dc_attr = get_dc_attr( hdc );
|
||||
return dc_attr ? dc_attr->text_align : 0;
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* GetCurrentPositionEx (GDI32.@)
|
||||
*/
|
||||
|
|
|
@ -130,7 +130,6 @@ typedef struct tagDC
|
|||
POINT brush_org;
|
||||
|
||||
DWORD mapperFlags; /* Font mapper flags */
|
||||
WORD textAlign; /* Text alignment from SetTextAlign() */
|
||||
INT charExtra; /* Spacing from SetTextCharacterExtra() */
|
||||
INT breakExtra; /* breakTotalExtra / breakCount */
|
||||
INT breakRem; /* breakTotalExtra % breakCount */
|
||||
|
|
|
@ -100,6 +100,7 @@ typedef struct DC_ATTR
|
|||
{
|
||||
POINT cur_pos;
|
||||
INT graphics_mode;
|
||||
WORD text_align;
|
||||
void *emf;
|
||||
} DC_ATTR;
|
||||
|
||||
|
|
Loading…
Reference in New Issue