mapping.c 13.4 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
 *
 * 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
18
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
Alexandre Julliard's avatar
Alexandre Julliard committed
19 20
 */

21 22 23 24 25
#include <stdarg.h>

#include "windef.h"
#include "winbase.h"
#include "wingdi.h"
Michael Stefaniuc's avatar
Michael Stefaniuc committed
26
#include "wownt32.h"
27
#include "gdi_private.h"
28
#include "wine/debug.h"
Alexandre Julliard's avatar
Alexandre Julliard committed
29

30
WINE_DEFAULT_DEBUG_CHANNEL(gdi);
31

Alexandre Julliard's avatar
Alexandre Julliard committed
32 33 34 35 36 37

/***********************************************************************
 *           MAPPING_FixIsotropic
 *
 * Fix viewport extensions for isotropic mode.
 */
38
static void MAPPING_FixIsotropic( DC * dc )
Alexandre Julliard's avatar
Alexandre Julliard committed
39
{
40 41 42 43 44
    double xdim = fabs((double)dc->vportExtX * GetDeviceCaps( dc->hSelf, HORZSIZE ) /
                  (GetDeviceCaps( dc->hSelf, HORZRES ) * dc->wndExtX));
    double ydim = fabs((double)dc->vportExtY * GetDeviceCaps( dc->hSelf, VERTSIZE ) /
                  (GetDeviceCaps( dc->hSelf, VERTRES ) * dc->wndExtY));

Alexandre Julliard's avatar
Alexandre Julliard committed
45 46
    if (xdim > ydim)
    {
47 48 49
        INT mincx = (dc->vportExtX >= 0) ? 1 : -1;
        dc->vportExtX = floor(dc->vportExtX * ydim / xdim + 0.5);
        if (!dc->vportExtX) dc->vportExtX = mincx;
Alexandre Julliard's avatar
Alexandre Julliard committed
50 51 52
    }
    else
    {
53 54 55
        INT mincy = (dc->vportExtY >= 0) ? 1 : -1;
        dc->vportExtY = floor(dc->vportExtY * xdim / ydim + 0.5);
        if (!dc->vportExtY) dc->vportExtY = mincy;
56
    }
Alexandre Julliard's avatar
Alexandre Julliard committed
57 58 59 60
}


/***********************************************************************
Patrik Stridvall's avatar
Patrik Stridvall committed
61
 *           DPtoLP    (GDI.67)
Alexandre Julliard's avatar
Alexandre Julliard committed
62
 */
Alexandre Julliard's avatar
Alexandre Julliard committed
63
BOOL16 WINAPI DPtoLP16( HDC16 hdc, LPPOINT16 points, INT16 count )
Alexandre Julliard's avatar
Alexandre Julliard committed
64
{
65
    DC * dc = get_dc_ptr( HDC_32(hdc) );
Alexandre Julliard's avatar
Alexandre Julliard committed
66 67 68 69
    if (!dc) return FALSE;

    while (count--)
    {
70 71
        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
72 73
        points++;
    }
74
    release_dc_ptr( dc );
Alexandre Julliard's avatar
Alexandre Julliard committed
75 76 77 78 79
    return TRUE;
}


/***********************************************************************
80
 *           DPtoLP    (GDI32.@)
Alexandre Julliard's avatar
Alexandre Julliard committed
81
 */
82
BOOL WINAPI DPtoLP( HDC hdc, LPPOINT points, INT count )
Alexandre Julliard's avatar
Alexandre Julliard committed
83
{
84
    DC * dc = get_dc_ptr( hdc );
Alexandre Julliard's avatar
Alexandre Julliard committed
85 86
    if (!dc) return FALSE;

87
    if (dc->vport2WorldValid)
Alexandre Julliard's avatar
Alexandre Julliard committed
88
    {
89 90 91 92 93 94 95 96 97 98 99 100
        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
101
    }
102
    release_dc_ptr( dc );
103
    return (count < 0);
Alexandre Julliard's avatar
Alexandre Julliard committed
104 105 106 107
}


/***********************************************************************
Patrik Stridvall's avatar
Patrik Stridvall committed
108
 *           LPtoDP    (GDI.99)
Alexandre Julliard's avatar
Alexandre Julliard committed
109
 */
Alexandre Julliard's avatar
Alexandre Julliard committed
110
BOOL16 WINAPI LPtoDP16( HDC16 hdc, LPPOINT16 points, INT16 count )
Alexandre Julliard's avatar
Alexandre Julliard committed
111
{
112
    DC * dc = get_dc_ptr( HDC_32(hdc) );
Alexandre Julliard's avatar
Alexandre Julliard committed
113 114 115 116
    if (!dc) return FALSE;

    while (count--)
    {
117 118
        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
119 120
        points++;
    }
121
    release_dc_ptr( dc );
Alexandre Julliard's avatar
Alexandre Julliard committed
122 123 124 125 126
    return TRUE;
}


/***********************************************************************
127
 *           LPtoDP    (GDI32.@)
Alexandre Julliard's avatar
Alexandre Julliard committed
128
 */
129
BOOL WINAPI LPtoDP( HDC hdc, LPPOINT points, INT count )
Alexandre Julliard's avatar
Alexandre Julliard committed
130
{
131
    DC * dc = get_dc_ptr( hdc );
Alexandre Julliard's avatar
Alexandre Julliard committed
132 133 134 135
    if (!dc) return FALSE;

    while (count--)
    {
136 137 138 139 140 141 142 143
        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
144 145
        points++;
    }
146
    release_dc_ptr( dc );
Alexandre Julliard's avatar
Alexandre Julliard committed
147 148 149 150 151
    return TRUE;
}


/***********************************************************************
152
 *           SetMapMode    (GDI32.@)
Alexandre Julliard's avatar
Alexandre Julliard committed
153
 */
154
INT WINAPI SetMapMode( HDC hdc, INT mode )
Alexandre Julliard's avatar
Alexandre Julliard committed
155
{
156
    INT ret;
157 158
    INT horzSize, vertSize, horzRes, vertRes;

159
    DC * dc = get_dc_ptr( hdc );
Alexandre Julliard's avatar
Alexandre Julliard committed
160
    if (!dc) return 0;
161 162
    if (dc->funcs->pSetMapMode)
    {
163 164 165 166 167 168
        if((ret = dc->funcs->pSetMapMode( dc->physDev, mode )) != TRUE)
	{
	    if(ret == GDI_NO_MORE_WORK)
	        ret = TRUE;
	    goto done;
	}
169
    }
Alexandre Julliard's avatar
Alexandre Julliard committed
170

171
    TRACE("%p %d\n", hdc, mode );
172

173
    ret = dc->MapMode;
174 175 176 177

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

178 179 180 181
    horzSize = GetDeviceCaps( hdc, HORZSIZE );
    vertSize = GetDeviceCaps( hdc, VERTSIZE );
    horzRes  = GetDeviceCaps( hdc, HORZRES );
    vertRes  = GetDeviceCaps( hdc, VERTRES );
Alexandre Julliard's avatar
Alexandre Julliard committed
182 183
    switch(mode)
    {
184 185 186 187 188 189 190 191 192 193
    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;
194 195 196 197 198 199 200 201
        dc->vportExtX = horzRes;
        dc->vportExtY = -vertRes;
        break;
    case MM_HIMETRIC:
        dc->wndExtX   = horzSize * 100;
        dc->wndExtY   = vertSize * 100;
        dc->vportExtX = horzRes;
        dc->vportExtY = -vertRes;
202 203
        break;
    case MM_LOENGLISH:
204 205 206 207
        dc->wndExtX   = MulDiv(1000, horzSize, 254);
        dc->wndExtY   = MulDiv(1000, vertSize, 254);
        dc->vportExtX = horzRes;
        dc->vportExtY = -vertRes;
208 209
        break;
    case MM_HIENGLISH:
210 211 212 213
        dc->wndExtX   = MulDiv(10000, horzSize, 254);
        dc->wndExtY   = MulDiv(10000, vertSize, 254);
        dc->vportExtX = horzRes;
        dc->vportExtY = -vertRes;
214 215
        break;
    case MM_TWIPS:
216 217 218 219
        dc->wndExtX   = MulDiv(14400, horzSize, 254);
        dc->wndExtY   = MulDiv(14400, vertSize, 254);
        dc->vportExtX = horzRes;
        dc->vportExtY = -vertRes;
220 221 222 223 224
        break;
    case MM_ANISOTROPIC:
        break;
    default:
        goto done;
Alexandre Julliard's avatar
Alexandre Julliard committed
225
    }
226
    dc->MapMode = mode;
Alexandre Julliard's avatar
Alexandre Julliard committed
227
    DC_UpdateXforms( dc );
228
 done:
229
    release_dc_ptr( dc );
230
    return ret;
Alexandre Julliard's avatar
Alexandre Julliard committed
231 232 233 234
}


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


/***********************************************************************
274
 *           SetViewportOrgEx    (GDI32.@)
Alexandre Julliard's avatar
Alexandre Julliard committed
275
 */
276
BOOL WINAPI SetViewportOrgEx( HDC hdc, INT x, INT y, LPPOINT pt )
Alexandre Julliard's avatar
Alexandre Julliard committed
277
{
278
    INT ret = TRUE;
279
    DC * dc = get_dc_ptr( hdc );
Alexandre Julliard's avatar
Alexandre Julliard committed
280 281 282
    if (!dc) return FALSE;
    if (dc->funcs->pSetViewportOrg)
    {
283 284 285 286 287 288 289 290 291 292 293
        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
294
    }
295 296 297 298 299
    dc->vportOrgX = x;
    dc->vportOrgY = y;
    DC_UpdateXforms( dc );

 done:
300
    release_dc_ptr( dc );
301
    return ret;
Alexandre Julliard's avatar
Alexandre Julliard committed
302 303 304 305
}


/***********************************************************************
306
 *           SetWindowExtEx    (GDI32.@)
Alexandre Julliard's avatar
Alexandre Julliard committed
307
 */
308
BOOL WINAPI SetWindowExtEx( HDC hdc, INT x, INT y, LPSIZE size )
Alexandre Julliard's avatar
Alexandre Julliard committed
309
{
310
    INT ret = TRUE;
311
    DC * dc = get_dc_ptr( hdc );
Alexandre Julliard's avatar
Alexandre Julliard committed
312
    if (!dc) return FALSE;
313 314
    if (dc->funcs->pSetWindowExt)
    {
315 316 317 318 319 320
        if((ret = dc->funcs->pSetWindowExt( dc->physDev, x, y )) != TRUE)
	{
	    if(ret == GDI_NO_MORE_WORK)
	        ret = TRUE;
	    goto done;
	}
321
    }
Alexandre Julliard's avatar
Alexandre Julliard committed
322 323 324 325 326
    if (size)
    {
	size->cx = dc->wndExtX;
	size->cy = dc->wndExtY;
    }
327
    if ((dc->MapMode != MM_ISOTROPIC) && (dc->MapMode != MM_ANISOTROPIC))
328 329 330 331 332 333
	goto done;
    if (!x || !y)
    {
        ret = FALSE;
        goto done;
    }
Alexandre Julliard's avatar
Alexandre Julliard committed
334 335
    dc->wndExtX = x;
    dc->wndExtY = y;
336 337 338 339
    /* The API docs say that you should call SetWindowExtEx before
       SetViewportExtEx. This advice does not imply that Windows
       doesn't ensure the isotropic mapping after SetWindowExtEx! */
    if (dc->MapMode == MM_ISOTROPIC) MAPPING_FixIsotropic( dc );
Alexandre Julliard's avatar
Alexandre Julliard committed
340
    DC_UpdateXforms( dc );
341
 done:
342
    release_dc_ptr( dc );
343
    return ret;
Alexandre Julliard's avatar
Alexandre Julliard committed
344 345 346 347
}


/***********************************************************************
348
 *           SetWindowOrgEx    (GDI32.@)
Alexandre Julliard's avatar
Alexandre Julliard committed
349
 */
350
BOOL WINAPI SetWindowOrgEx( HDC hdc, INT x, INT y, LPPOINT pt )
Alexandre Julliard's avatar
Alexandre Julliard committed
351
{
352
    INT ret = TRUE;
353
    DC * dc = get_dc_ptr( hdc );
Alexandre Julliard's avatar
Alexandre Julliard committed
354
    if (!dc) return FALSE;
355
    if (dc->funcs->pSetWindowOrg)
Alexandre Julliard's avatar
Alexandre Julliard committed
356
    {
357 358 359 360 361 362 363 364 365 366 367
        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
368
    }
369 370 371 372
    dc->wndOrgX = x;
    dc->wndOrgY = y;
    DC_UpdateXforms( dc );
 done:
373
    release_dc_ptr( dc );
374
    return ret;
Alexandre Julliard's avatar
Alexandre Julliard committed
375 376 377 378
}


/***********************************************************************
379
 *           OffsetViewportOrgEx    (GDI32.@)
Alexandre Julliard's avatar
Alexandre Julliard committed
380
 */
381
BOOL WINAPI OffsetViewportOrgEx( HDC hdc, INT x, INT y, LPPOINT pt)
Alexandre Julliard's avatar
Alexandre Julliard committed
382
{
383
    INT ret = TRUE;
384
    DC * dc = get_dc_ptr( hdc );
Alexandre Julliard's avatar
Alexandre Julliard committed
385 386 387
    if (!dc) return FALSE;
    if (dc->funcs->pOffsetViewportOrg)
    {
388 389 390 391 392 393
        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
394
    }
395 396 397 398 399 400 401 402 403
    if (pt)
    {
        pt->x = dc->vportOrgX;
	pt->y = dc->vportOrgY;
    }
    dc->vportOrgX += x;
    dc->vportOrgY += y;
    DC_UpdateXforms( dc );
 done:
404
    release_dc_ptr( dc );
405
    return ret;
Alexandre Julliard's avatar
Alexandre Julliard committed
406 407 408 409
}


/***********************************************************************
410
 *           OffsetWindowOrgEx    (GDI32.@)
Alexandre Julliard's avatar
Alexandre Julliard committed
411
 */
412
BOOL WINAPI OffsetWindowOrgEx( HDC hdc, INT x, INT y, LPPOINT pt )
Alexandre Julliard's avatar
Alexandre Julliard committed
413
{
414
    INT ret = TRUE;
415
    DC * dc = get_dc_ptr( hdc );
Alexandre Julliard's avatar
Alexandre Julliard committed
416 417 418
    if (!dc) return FALSE;
    if (dc->funcs->pOffsetWindowOrg)
    {
419 420 421 422 423 424 425 426 427 428 429
        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
430
    }
431 432 433 434
    dc->wndOrgX += x;
    dc->wndOrgY += y;
    DC_UpdateXforms( dc );
 done:
435
    release_dc_ptr( dc );
436
    return ret;
Alexandre Julliard's avatar
Alexandre Julliard committed
437 438 439 440
}


/***********************************************************************
441
 *           ScaleViewportExtEx    (GDI32.@)
Alexandre Julliard's avatar
Alexandre Julliard committed
442
 */
443 444
BOOL WINAPI ScaleViewportExtEx( HDC hdc, INT xNum, INT xDenom,
                                    INT yNum, INT yDenom, LPSIZE size )
Alexandre Julliard's avatar
Alexandre Julliard committed
445
{
446
    INT ret = TRUE;
447
    DC * dc = get_dc_ptr( hdc );
Alexandre Julliard's avatar
Alexandre Julliard committed
448 449
    if (!dc) return FALSE;
    if (dc->funcs->pScaleViewportExt)
450
    {
451 452 453 454 455 456
        if((ret = dc->funcs->pScaleViewportExt( dc->physDev, xNum, xDenom, yNum, yDenom )) != TRUE)
	{
	    if(ret == GDI_NO_MORE_WORK)
	        ret = TRUE;
	    goto done;
	}
457
    }
Alexandre Julliard's avatar
Alexandre Julliard committed
458 459 460 461 462
    if (size)
    {
	size->cx = dc->vportExtX;
	size->cy = dc->vportExtY;
    }
463
    if ((dc->MapMode != MM_ISOTROPIC) && (dc->MapMode != MM_ANISOTROPIC))
464 465 466 467 468 469
	goto done;
    if (!xNum || !xDenom || !xNum || !yDenom)
    {
        ret = FALSE;
        goto done;
    }
Alexandre Julliard's avatar
Alexandre Julliard committed
470 471 472 473
    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;
474
    if (dc->MapMode == MM_ISOTROPIC) MAPPING_FixIsotropic( dc );
Alexandre Julliard's avatar
Alexandre Julliard committed
475
    DC_UpdateXforms( dc );
476
 done:
477
    release_dc_ptr( dc );
478
    return ret;
Alexandre Julliard's avatar
Alexandre Julliard committed
479 480 481 482
}


/***********************************************************************
483
 *           ScaleWindowExtEx    (GDI32.@)
Alexandre Julliard's avatar
Alexandre Julliard committed
484
 */
485 486
BOOL WINAPI ScaleWindowExtEx( HDC hdc, INT xNum, INT xDenom,
                                  INT yNum, INT yDenom, LPSIZE size )
Alexandre Julliard's avatar
Alexandre Julliard committed
487
{
488
    INT ret = TRUE;
489
    DC * dc = get_dc_ptr( hdc );
Alexandre Julliard's avatar
Alexandre Julliard committed
490 491
    if (!dc) return FALSE;
    if (dc->funcs->pScaleWindowExt)
492
    {
493 494 495 496 497 498
        if((ret = dc->funcs->pScaleWindowExt( dc->physDev, xNum, xDenom, yNum, yDenom )) != TRUE)
	{
	    if(ret == GDI_NO_MORE_WORK)
	        ret = TRUE;
	    goto done;
	}
499
    }
Alexandre Julliard's avatar
Alexandre Julliard committed
500 501 502 503 504
    if (size)
    {
	size->cx = dc->wndExtX;
	size->cy = dc->wndExtY;
    }
505
    if ((dc->MapMode != MM_ISOTROPIC) && (dc->MapMode != MM_ANISOTROPIC))
506 507 508 509 510 511
	goto done;
    if (!xNum || !xDenom || !xNum || !yDenom)
    {
        ret = FALSE;
        goto done;
    }
Alexandre Julliard's avatar
Alexandre Julliard committed
512 513 514 515
    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;
516
    if (dc->MapMode == MM_ISOTROPIC) MAPPING_FixIsotropic( dc );
Alexandre Julliard's avatar
Alexandre Julliard committed
517
    DC_UpdateXforms( dc );
518
 done:
519
    release_dc_ptr( dc );
520
    return ret;
Alexandre Julliard's avatar
Alexandre Julliard committed
521
}