Commit 3d700e8c authored by Matteo Bruni's avatar Matteo Bruni Committed by Alexandre Julliard

win32u: Use GDI_ROUND() in a few more places.

parent c7b93aa3
...@@ -98,13 +98,13 @@ static void MAPPING_FixIsotropic( DC * dc ) ...@@ -98,13 +98,13 @@ static void MAPPING_FixIsotropic( DC * dc )
if (xdim > ydim) if (xdim > ydim)
{ {
INT mincx = (dc->attr->vport_ext.cx >= 0) ? 1 : -1; INT mincx = (dc->attr->vport_ext.cx >= 0) ? 1 : -1;
dc->attr->vport_ext.cx = floor(dc->attr->vport_ext.cx * ydim / xdim + 0.5); dc->attr->vport_ext.cx = GDI_ROUND( dc->attr->vport_ext.cx * ydim / xdim );
if (!dc->attr->vport_ext.cx) dc->attr->vport_ext.cx = mincx; if (!dc->attr->vport_ext.cx) dc->attr->vport_ext.cx = mincx;
} }
else else
{ {
INT mincy = (dc->attr->vport_ext.cy >= 0) ? 1 : -1; INT mincy = (dc->attr->vport_ext.cy >= 0) ? 1 : -1;
dc->attr->vport_ext.cy = floor(dc->attr->vport_ext.cy * xdim / ydim + 0.5); dc->attr->vport_ext.cy = GDI_ROUND( dc->attr->vport_ext.cy * xdim / ydim );
if (!dc->attr->vport_ext.cy) dc->attr->vport_ext.cy = mincy; if (!dc->attr->vport_ext.cy) dc->attr->vport_ext.cy = mincy;
} }
} }
...@@ -190,12 +190,12 @@ BOOL dp_to_lp( DC *dc, POINT *points, INT count ) ...@@ -190,12 +190,12 @@ BOOL dp_to_lp( DC *dc, POINT *points, INT count )
{ {
double x = points->x; double x = points->x;
double y = points->y; double y = points->y;
points->x = floor( x * dc->xformVport2World.eM11 + points->x = GDI_ROUND( x * dc->xformVport2World.eM11 +
y * dc->xformVport2World.eM21 + y * dc->xformVport2World.eM21 +
dc->xformVport2World.eDx + 0.5 ); dc->xformVport2World.eDx );
points->y = floor( x * dc->xformVport2World.eM12 + points->y = GDI_ROUND( x * dc->xformVport2World.eM12 +
y * dc->xformVport2World.eM22 + y * dc->xformVport2World.eM22 +
dc->xformVport2World.eDy + 0.5 ); dc->xformVport2World.eDy );
points++; points++;
} }
} }
...@@ -221,12 +221,12 @@ BOOL WINAPI NtGdiTransformPoints( HDC hdc, const POINT *points_in, POINT *points ...@@ -221,12 +221,12 @@ BOOL WINAPI NtGdiTransformPoints( HDC hdc, const POINT *points_in, POINT *points
{ {
double x = points_in[i].x; double x = points_in[i].x;
double y = points_in[i].y; double y = points_in[i].y;
points_out[i].x = floor( x * dc->xformWorld2Vport.eM11 + points_out[i].x = GDI_ROUND( x * dc->xformWorld2Vport.eM11 +
y * dc->xformWorld2Vport.eM21 + y * dc->xformWorld2Vport.eM21 +
dc->xformWorld2Vport.eDx + 0.5 ); dc->xformWorld2Vport.eDx );
points_out[i].y = floor( x * dc->xformWorld2Vport.eM12 + points_out[i].y = GDI_ROUND( x * dc->xformWorld2Vport.eM12 +
y * dc->xformWorld2Vport.eM22 + y * dc->xformWorld2Vport.eM22 +
dc->xformWorld2Vport.eDy + 0.5 ); dc->xformWorld2Vport.eDy );
} }
ret = TRUE; ret = TRUE;
break; break;
...@@ -237,12 +237,12 @@ BOOL WINAPI NtGdiTransformPoints( HDC hdc, const POINT *points_in, POINT *points ...@@ -237,12 +237,12 @@ BOOL WINAPI NtGdiTransformPoints( HDC hdc, const POINT *points_in, POINT *points
{ {
double x = points_in[i].x; double x = points_in[i].x;
double y = points_in[i].y; double y = points_in[i].y;
points_out[i].x = floor( x * dc->xformVport2World.eM11 + points_out[i].x = GDI_ROUND( x * dc->xformVport2World.eM11 +
y * dc->xformVport2World.eM21 + y * dc->xformVport2World.eM21 +
dc->xformVport2World.eDx + 0.5 ); dc->xformVport2World.eDx );
points_out[i].y = floor( x * dc->xformVport2World.eM12 + points_out[i].y = GDI_ROUND( x * dc->xformVport2World.eM12 +
y * dc->xformVport2World.eM22 + y * dc->xformVport2World.eM22 +
dc->xformVport2World.eDy + 0.5 ); dc->xformVport2World.eDy );
} }
ret = TRUE; ret = TRUE;
break; break;
...@@ -268,12 +268,12 @@ void lp_to_dp( DC *dc, POINT *points, INT count ) ...@@ -268,12 +268,12 @@ void lp_to_dp( DC *dc, POINT *points, INT count )
{ {
double x = points->x; double x = points->x;
double y = points->y; double y = points->y;
points->x = floor( x * dc->xformWorld2Vport.eM11 + points->x = GDI_ROUND( x * dc->xformWorld2Vport.eM11 +
y * dc->xformWorld2Vport.eM21 + y * dc->xformWorld2Vport.eM21 +
dc->xformWorld2Vport.eDx + 0.5 ); dc->xformWorld2Vport.eDx );
points->y = floor( x * dc->xformWorld2Vport.eM12 + points->y = GDI_ROUND( x * dc->xformWorld2Vport.eM12 +
y * dc->xformWorld2Vport.eM22 + y * dc->xformWorld2Vport.eM22 +
dc->xformWorld2Vport.eDy + 0.5 ); dc->xformWorld2Vport.eDy );
points++; points++;
} }
} }
......
...@@ -866,8 +866,8 @@ static void translate( POINT *pt, UINT count, const XFORM *xform ) ...@@ -866,8 +866,8 @@ static void translate( POINT *pt, UINT count, const XFORM *xform )
{ {
double x = pt->x; double x = pt->x;
double y = pt->y; double y = pt->y;
pt->x = floor( x * xform->eM11 + y * xform->eM21 + xform->eDx + 0.5 ); pt->x = GDI_ROUND( x * xform->eM11 + y * xform->eM21 + xform->eDx );
pt->y = floor( x * xform->eM12 + y * xform->eM22 + xform->eDy + 0.5 ); pt->y = GDI_ROUND( x * xform->eM12 + y * xform->eM22 + xform->eDy );
pt++; pt++;
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment