mapping.c 13.1 KB
Newer Older
Alexandre Julliard's avatar
Alexandre Julliard committed
1 2 3 4
/*
 * GDI mapping mode functions
 *
 * Copyright 1993 Alexandre Julliard
5 6 7 8 9 10 11 12 13 14 15 16 17 18
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
Alexandre Julliard's avatar
Alexandre Julliard committed
19 20
 */

21
#include "gdi.h"
Michael Stefaniuc's avatar
Michael Stefaniuc committed
22
#include "wownt32.h"
23
#include "wine/debug.h"
Alexandre Julliard's avatar
Alexandre Julliard committed
24

25
WINE_DEFAULT_DEBUG_CHANNEL(gdi);
26

Alexandre Julliard's avatar
Alexandre Julliard committed
27 28 29 30 31 32 33 34

/***********************************************************************
 *           MAPPING_FixIsotropic
 *
 * Fix viewport extensions for isotropic mode.
 */
void MAPPING_FixIsotropic( DC * dc )
{
35 36 37 38
    double xdim = (double)dc->vportExtX * GetDeviceCaps( dc->hSelf, HORZSIZE ) /
                  (GetDeviceCaps( dc->hSelf, HORZRES ) * dc->wndExtX);
    double ydim = (double)dc->vportExtY * GetDeviceCaps( dc->hSelf, VERTSIZE ) /
                  (GetDeviceCaps( dc->hSelf, VERTRES ) * dc->wndExtY);
Alexandre Julliard's avatar
Alexandre Julliard committed
39 40
    if (xdim > ydim)
    {
41
	dc->vportExtX = floor(dc->vportExtX * fabs( ydim / xdim ) + 0.5);
Alexandre Julliard's avatar
Alexandre Julliard committed
42 43 44 45
	if (!dc->vportExtX) dc->vportExtX = 1;
    }
    else
    {
46
	dc->vportExtY = floor(dc->vportExtY * fabs( xdim / ydim ) + 0.5);
Alexandre Julliard's avatar
Alexandre Julliard committed
47
	if (!dc->vportExtY) dc->vportExtY = 1;
48
    }
Alexandre Julliard's avatar
Alexandre Julliard committed
49 50 51 52
}


/***********************************************************************
Patrik Stridvall's avatar
Patrik Stridvall committed
53
 *           DPtoLP    (GDI.67)
Alexandre Julliard's avatar
Alexandre Julliard committed
54
 */
Alexandre Julliard's avatar
Alexandre Julliard committed
55
BOOL16 WINAPI DPtoLP16( HDC16 hdc, LPPOINT16 points, INT16 count )
Alexandre Julliard's avatar
Alexandre Julliard committed
56
{
Michael Stefaniuc's avatar
Michael Stefaniuc committed
57
    DC * dc = DC_GetDCPtr( HDC_32(hdc) );
Alexandre Julliard's avatar
Alexandre Julliard committed
58 59 60 61
    if (!dc) return FALSE;

    while (count--)
    {
62 63
        points->x = MulDiv( points->x - dc->vportOrgX, dc->wndExtX, dc->vportExtX ) + dc->wndOrgX;
        points->y = MulDiv( points->y - dc->vportOrgY, dc->wndExtY, dc->vportExtY ) + dc->wndOrgY;
Alexandre Julliard's avatar
Alexandre Julliard committed
64 65
        points++;
    }
Michael Stefaniuc's avatar
Michael Stefaniuc committed
66
    GDI_ReleaseObj( HDC_32(hdc) );
Alexandre Julliard's avatar
Alexandre Julliard committed
67 68 69 70 71
    return TRUE;
}


/***********************************************************************
72
 *           DPtoLP    (GDI32.@)
Alexandre Julliard's avatar
Alexandre Julliard committed
73
 */
74
BOOL WINAPI DPtoLP( HDC hdc, LPPOINT points, INT count )
Alexandre Julliard's avatar
Alexandre Julliard committed
75
{
76
    DC * dc = DC_GetDCPtr( hdc );
Alexandre Julliard's avatar
Alexandre Julliard committed
77 78
    if (!dc) return FALSE;

79
    if (dc->vport2WorldValid)
Alexandre Julliard's avatar
Alexandre Julliard committed
80
    {
81 82 83 84 85 86 87 88 89 90 91 92
        while (count--)
        {
            FLOAT x = points->x;
            FLOAT y = points->y;
            points->x = floor( x * dc->xformVport2World.eM11 +
                               y * dc->xformVport2World.eM21 +
                               dc->xformVport2World.eDx + 0.5 );
            points->y = floor( x * dc->xformVport2World.eM12 +
                               y * dc->xformVport2World.eM22 +
                               dc->xformVport2World.eDy + 0.5 );
            points++;
        }
Alexandre Julliard's avatar
Alexandre Julliard committed
93
    }
94 95
    GDI_ReleaseObj( hdc );
    return (count < 0);
Alexandre Julliard's avatar
Alexandre Julliard committed
96 97 98 99
}


/***********************************************************************
Patrik Stridvall's avatar
Patrik Stridvall committed
100
 *           LPtoDP    (GDI.99)
Alexandre Julliard's avatar
Alexandre Julliard committed
101
 */
Alexandre Julliard's avatar
Alexandre Julliard committed
102
BOOL16 WINAPI LPtoDP16( HDC16 hdc, LPPOINT16 points, INT16 count )
Alexandre Julliard's avatar
Alexandre Julliard committed
103
{
Michael Stefaniuc's avatar
Michael Stefaniuc committed
104
    DC * dc = DC_GetDCPtr( HDC_32(hdc) );
Alexandre Julliard's avatar
Alexandre Julliard committed
105 106 107 108
    if (!dc) return FALSE;

    while (count--)
    {
109 110
        points->x = MulDiv( points->x - dc->wndOrgX, dc->vportExtX, dc->wndExtX ) + dc->vportOrgX;
        points->y = MulDiv( points->y - dc->wndOrgY, dc->vportExtY, dc->wndExtY ) + dc->vportOrgY;
Alexandre Julliard's avatar
Alexandre Julliard committed
111 112
        points++;
    }
Michael Stefaniuc's avatar
Michael Stefaniuc committed
113
    GDI_ReleaseObj( HDC_32(hdc) );
Alexandre Julliard's avatar
Alexandre Julliard committed
114 115 116 117 118
    return TRUE;
}


/***********************************************************************
119
 *           LPtoDP    (GDI32.@)
Alexandre Julliard's avatar
Alexandre Julliard committed
120
 */
121
BOOL WINAPI LPtoDP( HDC hdc, LPPOINT points, INT count )
Alexandre Julliard's avatar
Alexandre Julliard committed
122
{
123
    DC * dc = DC_GetDCPtr( hdc );
Alexandre Julliard's avatar
Alexandre Julliard committed
124 125 126 127
    if (!dc) return FALSE;

    while (count--)
    {
128 129 130 131 132 133 134 135
        FLOAT x = points->x;
        FLOAT y = points->y;
        points->x = floor( x * dc->xformWorld2Vport.eM11 +
                           y * dc->xformWorld2Vport.eM21 +
                           dc->xformWorld2Vport.eDx + 0.5 );
        points->y = floor( x * dc->xformWorld2Vport.eM12 +
                           y * dc->xformWorld2Vport.eM22 +
                           dc->xformWorld2Vport.eDy + 0.5 );
Alexandre Julliard's avatar
Alexandre Julliard committed
136 137
        points++;
    }
138
    GDI_ReleaseObj( hdc );
Alexandre Julliard's avatar
Alexandre Julliard committed
139 140 141 142 143
    return TRUE;
}


/***********************************************************************
144
 *           SetMapMode    (GDI32.@)
Alexandre Julliard's avatar
Alexandre Julliard committed
145
 */
146
INT WINAPI SetMapMode( HDC hdc, INT mode )
Alexandre Julliard's avatar
Alexandre Julliard committed
147
{
148
    INT ret;
149 150
    INT horzSize, vertSize, horzRes, vertRes;

Alexandre Julliard's avatar
Alexandre Julliard committed
151 152
    DC * dc = DC_GetDCPtr( hdc );
    if (!dc) return 0;
153 154
    if (dc->funcs->pSetMapMode)
    {
155 156 157 158 159 160
        if((ret = dc->funcs->pSetMapMode( dc->physDev, mode )) != TRUE)
	{
	    if(ret == GDI_NO_MORE_WORK)
	        ret = TRUE;
	    goto done;
	}
161
    }
Alexandre Julliard's avatar
Alexandre Julliard committed
162

163
    TRACE("%p %d\n", hdc, mode );
164

165
    ret = dc->MapMode;
166 167 168 169

    if (mode == dc->MapMode && (mode == MM_ISOTROPIC || mode == MM_ANISOTROPIC))
        goto done;

170 171 172 173
    horzSize = GetDeviceCaps( hdc, HORZSIZE );
    vertSize = GetDeviceCaps( hdc, VERTSIZE );
    horzRes  = GetDeviceCaps( hdc, HORZRES );
    vertRes  = GetDeviceCaps( hdc, VERTRES );
Alexandre Julliard's avatar
Alexandre Julliard committed
174 175
    switch(mode)
    {
176 177 178 179 180 181 182 183 184 185
    case MM_TEXT:
        dc->wndExtX   = 1;
        dc->wndExtY   = 1;
        dc->vportExtX = 1;
        dc->vportExtY = 1;
        break;
    case MM_LOMETRIC:
    case MM_ISOTROPIC:
        dc->wndExtX   = horzSize * 10;
        dc->wndExtY   = vertSize * 10;
186 187 188 189 190 191 192 193
        dc->vportExtX = horzRes;
        dc->vportExtY = -vertRes;
        break;
    case MM_HIMETRIC:
        dc->wndExtX   = horzSize * 100;
        dc->wndExtY   = vertSize * 100;
        dc->vportExtX = horzRes;
        dc->vportExtY = -vertRes;
194 195
        break;
    case MM_LOENGLISH:
196 197 198 199
        dc->wndExtX   = MulDiv(1000, horzSize, 254);
        dc->wndExtY   = MulDiv(1000, vertSize, 254);
        dc->vportExtX = horzRes;
        dc->vportExtY = -vertRes;
200 201
        break;
    case MM_HIENGLISH:
202 203 204 205
        dc->wndExtX   = MulDiv(10000, horzSize, 254);
        dc->wndExtY   = MulDiv(10000, vertSize, 254);
        dc->vportExtX = horzRes;
        dc->vportExtY = -vertRes;
206 207
        break;
    case MM_TWIPS:
208 209 210 211
        dc->wndExtX   = MulDiv(14400, horzSize, 254);
        dc->wndExtY   = MulDiv(14400, vertSize, 254);
        dc->vportExtX = horzRes;
        dc->vportExtY = -vertRes;
212 213 214 215 216
        break;
    case MM_ANISOTROPIC:
        break;
    default:
        goto done;
Alexandre Julliard's avatar
Alexandre Julliard committed
217
    }
218
    dc->MapMode = mode;
Alexandre Julliard's avatar
Alexandre Julliard committed
219
    DC_UpdateXforms( dc );
220 221
 done:
    GDI_ReleaseObj( hdc );
222
    return ret;
Alexandre Julliard's avatar
Alexandre Julliard committed
223 224 225 226
}


/***********************************************************************
227
 *           SetViewportExtEx    (GDI32.@)
Alexandre Julliard's avatar
Alexandre Julliard committed
228
 */
229
BOOL WINAPI SetViewportExtEx( HDC hdc, INT x, INT y, LPSIZE size )
Alexandre Julliard's avatar
Alexandre Julliard committed
230
{
231
    INT ret = TRUE;
Alexandre Julliard's avatar
Alexandre Julliard committed
232 233 234
    DC * dc = DC_GetDCPtr( hdc );
    if (!dc) return FALSE;
    if (dc->funcs->pSetViewportExt)
235
    {
236 237 238 239 240 241
        if((ret = dc->funcs->pSetViewportExt( dc->physDev, x, y )) != TRUE)
	{
	    if(ret == GDI_NO_MORE_WORK)
	        ret = TRUE;
	    goto done;
	}
242
    }
Alexandre Julliard's avatar
Alexandre Julliard committed
243 244 245 246 247
    if (size)
    {
	size->cx = dc->vportExtX;
	size->cy = dc->vportExtY;
    }
248
    if ((dc->MapMode != MM_ISOTROPIC) && (dc->MapMode != MM_ANISOTROPIC))
249 250 251 252 253 254
	goto done;
    if (!x || !y)
    {
        ret = FALSE;
        goto done;
    }
Alexandre Julliard's avatar
Alexandre Julliard committed
255 256
    dc->vportExtX = x;
    dc->vportExtY = y;
257
    if (dc->MapMode == MM_ISOTROPIC) MAPPING_FixIsotropic( dc );
Alexandre Julliard's avatar
Alexandre Julliard committed
258
    DC_UpdateXforms( dc );
259 260 261
 done:
    GDI_ReleaseObj( hdc );
    return ret;
Alexandre Julliard's avatar
Alexandre Julliard committed
262 263 264 265
}


/***********************************************************************
266
 *           SetViewportOrgEx    (GDI32.@)
Alexandre Julliard's avatar
Alexandre Julliard committed
267
 */
268
BOOL WINAPI SetViewportOrgEx( HDC hdc, INT x, INT y, LPPOINT pt )
Alexandre Julliard's avatar
Alexandre Julliard committed
269
{
270
    INT ret = TRUE;
Alexandre Julliard's avatar
Alexandre Julliard committed
271 272 273 274
    DC * dc = DC_GetDCPtr( hdc );
    if (!dc) return FALSE;
    if (dc->funcs->pSetViewportOrg)
    {
275 276 277 278 279 280 281 282 283 284 285
        if((ret = dc->funcs->pSetViewportOrg( dc->physDev, x, y )) != TRUE)
	{
	    if(ret == GDI_NO_MORE_WORK)
	        ret = TRUE;
	    goto done;
	}
    }
    if (pt)
    {
        pt->x = dc->vportOrgX;
	pt->y = dc->vportOrgY;
Alexandre Julliard's avatar
Alexandre Julliard committed
286
    }
287 288 289 290 291
    dc->vportOrgX = x;
    dc->vportOrgY = y;
    DC_UpdateXforms( dc );

 done:
292 293
    GDI_ReleaseObj( hdc );
    return ret;
Alexandre Julliard's avatar
Alexandre Julliard committed
294 295 296 297
}


/***********************************************************************
298
 *           SetWindowExtEx    (GDI32.@)
Alexandre Julliard's avatar
Alexandre Julliard committed
299
 */
300
BOOL WINAPI SetWindowExtEx( HDC hdc, INT x, INT y, LPSIZE size )
Alexandre Julliard's avatar
Alexandre Julliard committed
301
{
302
    INT ret = TRUE;
Alexandre Julliard's avatar
Alexandre Julliard committed
303 304
    DC * dc = DC_GetDCPtr( hdc );
    if (!dc) return FALSE;
305 306
    if (dc->funcs->pSetWindowExt)
    {
307 308 309 310 311 312
        if((ret = dc->funcs->pSetWindowExt( dc->physDev, x, y )) != TRUE)
	{
	    if(ret == GDI_NO_MORE_WORK)
	        ret = TRUE;
	    goto done;
	}
313
    }
Alexandre Julliard's avatar
Alexandre Julliard committed
314 315 316 317 318
    if (size)
    {
	size->cx = dc->wndExtX;
	size->cy = dc->wndExtY;
    }
319
    if ((dc->MapMode != MM_ISOTROPIC) && (dc->MapMode != MM_ANISOTROPIC))
320 321 322 323 324 325
	goto done;
    if (!x || !y)
    {
        ret = FALSE;
        goto done;
    }
Alexandre Julliard's avatar
Alexandre Julliard committed
326 327
    dc->wndExtX = x;
    dc->wndExtY = y;
328
    /* Windows fixes MM_ISOTROPIC mode only in SetViewportExtEx() */
Alexandre Julliard's avatar
Alexandre Julliard committed
329
    DC_UpdateXforms( dc );
330 331 332
 done:
    GDI_ReleaseObj( hdc );
    return ret;
Alexandre Julliard's avatar
Alexandre Julliard committed
333 334 335 336
}


/***********************************************************************
337
 *           SetWindowOrgEx    (GDI32.@)
Alexandre Julliard's avatar
Alexandre Julliard committed
338
 */
339
BOOL WINAPI SetWindowOrgEx( HDC hdc, INT x, INT y, LPPOINT pt )
Alexandre Julliard's avatar
Alexandre Julliard committed
340
{
341
    INT ret = TRUE;
Alexandre Julliard's avatar
Alexandre Julliard committed
342 343
    DC * dc = DC_GetDCPtr( hdc );
    if (!dc) return FALSE;
344
    if (dc->funcs->pSetWindowOrg)
Alexandre Julliard's avatar
Alexandre Julliard committed
345
    {
346 347 348 349 350 351 352 353 354 355 356
        if((ret = dc->funcs->pSetWindowOrg( dc->physDev, x, y )) != TRUE)
	{
	    if(ret == GDI_NO_MORE_WORK)
	        ret = TRUE;
	    goto done;
	}
    }
    if (pt)
    {
        pt->x = dc->wndOrgX;
	pt->y = dc->wndOrgY;
Alexandre Julliard's avatar
Alexandre Julliard committed
357
    }
358 359 360 361
    dc->wndOrgX = x;
    dc->wndOrgY = y;
    DC_UpdateXforms( dc );
 done:
362 363
    GDI_ReleaseObj( hdc );
    return ret;
Alexandre Julliard's avatar
Alexandre Julliard committed
364 365 366 367
}


/***********************************************************************
368
 *           OffsetViewportOrgEx    (GDI32.@)
Alexandre Julliard's avatar
Alexandre Julliard committed
369
 */
370
BOOL WINAPI OffsetViewportOrgEx( HDC hdc, INT x, INT y, LPPOINT pt)
Alexandre Julliard's avatar
Alexandre Julliard committed
371
{
372
    INT ret = TRUE;
Alexandre Julliard's avatar
Alexandre Julliard committed
373 374 375 376
    DC * dc = DC_GetDCPtr( hdc );
    if (!dc) return FALSE;
    if (dc->funcs->pOffsetViewportOrg)
    {
377 378 379 380 381 382
        if((ret = dc->funcs->pOffsetViewportOrg( dc->physDev, x, y )) != TRUE)
	{
	    if(ret == GDI_NO_MORE_WORK)
	        ret = TRUE;
	    goto done;
	}
Alexandre Julliard's avatar
Alexandre Julliard committed
383
    }
384 385 386 387 388 389 390 391 392
    if (pt)
    {
        pt->x = dc->vportOrgX;
	pt->y = dc->vportOrgY;
    }
    dc->vportOrgX += x;
    dc->vportOrgY += y;
    DC_UpdateXforms( dc );
 done:
393 394
    GDI_ReleaseObj( hdc );
    return ret;
Alexandre Julliard's avatar
Alexandre Julliard committed
395 396 397 398
}


/***********************************************************************
399
 *           OffsetWindowOrgEx    (GDI32.@)
Alexandre Julliard's avatar
Alexandre Julliard committed
400
 */
401
BOOL WINAPI OffsetWindowOrgEx( HDC hdc, INT x, INT y, LPPOINT pt )
Alexandre Julliard's avatar
Alexandre Julliard committed
402
{
403
    INT ret = TRUE;
Alexandre Julliard's avatar
Alexandre Julliard committed
404 405 406 407
    DC * dc = DC_GetDCPtr( hdc );
    if (!dc) return FALSE;
    if (dc->funcs->pOffsetWindowOrg)
    {
408 409 410 411 412 413 414 415 416 417 418
        if((ret = dc->funcs->pOffsetWindowOrg( dc->physDev, x, y )) != TRUE)
	{
	    if(ret == GDI_NO_MORE_WORK)
	        ret = TRUE;
	    goto done;
	}
    }
    if (pt)
    {
        pt->x = dc->wndOrgX;
	pt->y = dc->wndOrgY;
Alexandre Julliard's avatar
Alexandre Julliard committed
419
    }
420 421 422 423
    dc->wndOrgX += x;
    dc->wndOrgY += y;
    DC_UpdateXforms( dc );
 done:
424 425
    GDI_ReleaseObj( hdc );
    return ret;
Alexandre Julliard's avatar
Alexandre Julliard committed
426 427 428 429
}


/***********************************************************************
430
 *           ScaleViewportExtEx    (GDI32.@)
Alexandre Julliard's avatar
Alexandre Julliard committed
431
 */
432 433
BOOL WINAPI ScaleViewportExtEx( HDC hdc, INT xNum, INT xDenom,
                                    INT yNum, INT yDenom, LPSIZE size )
Alexandre Julliard's avatar
Alexandre Julliard committed
434
{
435
    INT ret = TRUE;
Alexandre Julliard's avatar
Alexandre Julliard committed
436 437 438
    DC * dc = DC_GetDCPtr( hdc );
    if (!dc) return FALSE;
    if (dc->funcs->pScaleViewportExt)
439
    {
440 441 442 443 444 445
        if((ret = dc->funcs->pScaleViewportExt( dc->physDev, xNum, xDenom, yNum, yDenom )) != TRUE)
	{
	    if(ret == GDI_NO_MORE_WORK)
	        ret = TRUE;
	    goto done;
	}
446
    }
Alexandre Julliard's avatar
Alexandre Julliard committed
447 448 449 450 451
    if (size)
    {
	size->cx = dc->vportExtX;
	size->cy = dc->vportExtY;
    }
452
    if ((dc->MapMode != MM_ISOTROPIC) && (dc->MapMode != MM_ANISOTROPIC))
453 454 455 456 457 458
	goto done;
    if (!xNum || !xDenom || !xNum || !yDenom)
    {
        ret = FALSE;
        goto done;
    }
Alexandre Julliard's avatar
Alexandre Julliard committed
459 460 461 462
    dc->vportExtX = (dc->vportExtX * xNum) / xDenom;
    dc->vportExtY = (dc->vportExtY * yNum) / yDenom;
    if (dc->vportExtX == 0) dc->vportExtX = 1;
    if (dc->vportExtY == 0) dc->vportExtY = 1;
463
    if (dc->MapMode == MM_ISOTROPIC) MAPPING_FixIsotropic( dc );
Alexandre Julliard's avatar
Alexandre Julliard committed
464
    DC_UpdateXforms( dc );
465 466 467
 done:
    GDI_ReleaseObj( hdc );
    return ret;
Alexandre Julliard's avatar
Alexandre Julliard committed
468 469 470 471
}


/***********************************************************************
472
 *           ScaleWindowExtEx    (GDI32.@)
Alexandre Julliard's avatar
Alexandre Julliard committed
473
 */
474 475
BOOL WINAPI ScaleWindowExtEx( HDC hdc, INT xNum, INT xDenom,
                                  INT yNum, INT yDenom, LPSIZE size )
Alexandre Julliard's avatar
Alexandre Julliard committed
476
{
477
    INT ret = TRUE;
Alexandre Julliard's avatar
Alexandre Julliard committed
478 479 480
    DC * dc = DC_GetDCPtr( hdc );
    if (!dc) return FALSE;
    if (dc->funcs->pScaleWindowExt)
481
    {
482 483 484 485 486 487
        if((ret = dc->funcs->pScaleWindowExt( dc->physDev, xNum, xDenom, yNum, yDenom )) != TRUE)
	{
	    if(ret == GDI_NO_MORE_WORK)
	        ret = TRUE;
	    goto done;
	}
488
    }
Alexandre Julliard's avatar
Alexandre Julliard committed
489 490 491 492 493
    if (size)
    {
	size->cx = dc->wndExtX;
	size->cy = dc->wndExtY;
    }
494
    if ((dc->MapMode != MM_ISOTROPIC) && (dc->MapMode != MM_ANISOTROPIC))
495 496 497 498 499 500
	goto done;
    if (!xNum || !xDenom || !xNum || !yDenom)
    {
        ret = FALSE;
        goto done;
    }
Alexandre Julliard's avatar
Alexandre Julliard committed
501 502 503 504
    dc->wndExtX = (dc->wndExtX * xNum) / xDenom;
    dc->wndExtY = (dc->wndExtY * yNum) / yDenom;
    if (dc->wndExtX == 0) dc->wndExtX = 1;
    if (dc->wndExtY == 0) dc->wndExtY = 1;
505
    if (dc->MapMode == MM_ISOTROPIC) MAPPING_FixIsotropic( dc );
Alexandre Julliard's avatar
Alexandre Julliard committed
506
    DC_UpdateXforms( dc );
507 508 509
 done:
    GDI_ReleaseObj( hdc );
    return ret;
Alexandre Julliard's avatar
Alexandre Julliard committed
510
}