mirror of
https://github.com/reactos/reactos.git
synced 2025-02-20 15:35:04 +00:00
[WIN32K]
- Take translation into account when inverting an XFORMOBJ - Always use the matrices from the DCATTR instead of DCLEVEL - Mark Device-to-World translation as invalid when the Window Origin is modified Fixes 7088 See issue #7088 for more details. svn path=/trunk/; revision=56970
This commit is contained in:
parent
c41d0cf560
commit
6a17ab3c5e
6 changed files with 19 additions and 11 deletions
|
@ -635,7 +635,7 @@ NtGdiOffsetWindowOrgEx(
|
|||
|
||||
pdcattr->ptlWindowOrg.x += XOffset;
|
||||
pdcattr->ptlWindowOrg.y += YOffset;
|
||||
pdcattr->flXform |= PAGE_XLATE_CHANGED;
|
||||
pdcattr->flXform |= PAGE_XLATE_CHANGED|DEVICE_TO_WORLD_INVALID;
|
||||
|
||||
DC_UnlockDc(dc);
|
||||
|
||||
|
@ -1052,8 +1052,6 @@ DC_vSetLayout(
|
|||
pdcattr->flXform |= (PAGE_EXTENTS_CHANGED |
|
||||
INVALIDATE_ATTRIBUTES |
|
||||
DEVICE_TO_WORLD_INVALID);
|
||||
|
||||
// DC_UpdateXforms(pdc);
|
||||
}
|
||||
|
||||
// NtGdiSetLayout
|
||||
|
|
|
@ -663,7 +663,7 @@ NtGdiRectangle(HDC hDC,
|
|||
}
|
||||
|
||||
/* Do we rotate or shear? */
|
||||
if (!(dc->dclevel.mxWorldToDevice.flAccel & XFORM_SCALE))
|
||||
if (!(dc->pdcattr->mxWorldToDevice.flAccel & XFORM_SCALE))
|
||||
{
|
||||
POINTL DestCoords[4];
|
||||
ULONG PolyCounts = 4;
|
||||
|
|
|
@ -1490,7 +1490,7 @@ ftGdiGetGlyphOutline(
|
|||
|
||||
pdcattr = dc->pdcattr;
|
||||
|
||||
MatrixS2XForm(&xForm, &dc->dclevel.mxWorldToDevice);
|
||||
MatrixS2XForm(&xForm, &dc->pdcattr->mxWorldToDevice);
|
||||
eM11 = xForm.eM11;
|
||||
|
||||
hFont = pdcattr->hlfntNew;
|
||||
|
|
|
@ -23,8 +23,8 @@ static __inline void INTERNAL_LPTODP_FLOAT(DC *dc, FLOAT_POINT *point)
|
|||
{
|
||||
FLOAT x, y;
|
||||
XFORM xformWorld2Vport;
|
||||
|
||||
MatrixS2XForm(&xformWorld2Vport, &dc->dclevel.mxWorldToDevice);
|
||||
|
||||
MatrixS2XForm(&xformWorld2Vport, &dc->pdcattr->mxWorldToDevice);
|
||||
|
||||
/* Perform the transformation */
|
||||
x = point->x;
|
||||
|
|
|
@ -76,7 +76,7 @@ GdiPathDPtoLP(PDC pdc, PPOINT ppt, INT count)
|
|||
{
|
||||
XFORMOBJ xo;
|
||||
|
||||
XFORMOBJ_vInit(&xo, &pdc->dclevel.mxDeviceToWorld);
|
||||
XFORMOBJ_vInit(&xo, &pdc->pdcattr->mxDeviceToWorld);
|
||||
return XFORMOBJ_bApplyXform(&xo, XF_LTOL, count, (PPOINTL)ppt, (PPOINTL)ppt);
|
||||
}
|
||||
|
||||
|
@ -124,7 +124,7 @@ PATH_FillPath( PDC dc, PPATH pPath )
|
|||
* tests show that resetting the graphics mode to GM_COMPATIBLE does
|
||||
* not reset the world transform.
|
||||
*/
|
||||
MatrixS2XForm(&xform, &dc->dclevel.mxWorldToPage);
|
||||
MatrixS2XForm(&xform, &dc->pdcattr->mxWorldToPage);
|
||||
|
||||
/* Set MM_TEXT */
|
||||
// IntGdiSetMapMode( dc, MM_TEXT );
|
||||
|
@ -1429,7 +1429,7 @@ BOOL FASTCALL PATH_StrokePath(DC *dc, PPATH pPath)
|
|||
szWindowExt = dc->pdcattr->szlWindowExt;
|
||||
ptWindowOrg = dc->pdcattr->ptlWindowOrg;
|
||||
|
||||
MatrixS2XForm(&xform, &dc->dclevel.mxWorldToPage);
|
||||
MatrixS2XForm(&xform, &dc->pdcattr->mxWorldToPage);
|
||||
|
||||
/* Set MM_TEXT */
|
||||
pdcattr->iMapMode = MM_TEXT;
|
||||
|
@ -1556,7 +1556,7 @@ end:
|
|||
pdcattr->ptlViewportOrg.y = ptViewportOrg.y;
|
||||
|
||||
/* Restore the world transform */
|
||||
XForm2MatrixS(&dc->dclevel.mxWorldToPage, &xform);
|
||||
XForm2MatrixS(&dc->pdcattr->mxWorldToPage, &xform);
|
||||
|
||||
/* If we've moved the current point then get its new position
|
||||
which will be in device (MM_TEXT) co-ords, convert it to
|
||||
|
|
|
@ -289,6 +289,16 @@ XFORMOBJ_iInverse(
|
|||
pmxDst->efM21 = pmxSrc->efM21;
|
||||
FLOATOBJ_Div(&pmxDst->efM21, &foDet);
|
||||
|
||||
/* Calculate the inverted x shift: Dx' = -Dx * M11' - Dy * M21' */
|
||||
pmxDst->efDx = pmxSrc->efDx;
|
||||
FLOATOBJ_Neg(&pmxDst->efDx);
|
||||
MulSub(&pmxDst->efDx, &pmxDst->efDx, &pmxDst->efM11, &pmxSrc->efDy, &pmxDst->efM21);
|
||||
|
||||
/* Calculate the inverted y shift: Dy' = -Dy * M22' - Dx * M12' */
|
||||
pmxDst->efDy = pmxSrc->efDy;
|
||||
FLOATOBJ_Neg(&pmxDst->efDy);
|
||||
MulSub(&pmxDst->efDy, &pmxDst->efDy, &pmxDst->efM22, &pmxSrc->efDx, &pmxDst->efM12);
|
||||
|
||||
/* Update accelerators and return complexity */
|
||||
return XFORMOBJ_UpdateAccel(pxoDst);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue