Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
e8e10e9a
Commit
e8e10e9a
authored
May 11, 2003
by
Dmitry Timoshkov
Committed by
Alexandre Julliard
May 11, 2003
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make SetMapMode set default window and viewport extents as in
Windows.
parent
d98f4a5e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
48 additions
and
44 deletions
+48
-44
mapping.c
graphics/mapping.c
+27
-23
enhmetafile.c
objects/enhmetafile.c
+21
-21
No files found.
graphics/mapping.c
View file @
e8e10e9a
...
...
@@ -38,12 +38,12 @@ void MAPPING_FixIsotropic( DC * dc )
(
GetDeviceCaps
(
dc
->
hSelf
,
VERTRES
)
*
dc
->
wndExtY
);
if
(
xdim
>
ydim
)
{
dc
->
vportExtX
=
dc
->
vportExtX
*
fabs
(
ydim
/
xdim
);
dc
->
vportExtX
=
floor
(
dc
->
vportExtX
*
fabs
(
ydim
/
xdim
)
+
0
.
5
);
if
(
!
dc
->
vportExtX
)
dc
->
vportExtX
=
1
;
}
else
{
dc
->
vportExtY
=
dc
->
vportExtY
*
fabs
(
xdim
/
ydim
);
dc
->
vportExtY
=
floor
(
dc
->
vportExtY
*
fabs
(
xdim
/
ydim
)
+
0
.
5
);
if
(
!
dc
->
vportExtY
)
dc
->
vportExtY
=
1
;
}
}
...
...
@@ -163,6 +163,10 @@ INT WINAPI SetMapMode( HDC hdc, INT mode )
TRACE
(
"%p %d
\n
"
,
hdc
,
mode
);
ret
=
dc
->
MapMode
;
if
(
mode
==
dc
->
MapMode
&&
(
mode
==
MM_ISOTROPIC
||
mode
==
MM_ANISOTROPIC
))
goto
done
;
horzSize
=
GetDeviceCaps
(
hdc
,
HORZSIZE
);
vertSize
=
GetDeviceCaps
(
hdc
,
VERTSIZE
);
horzRes
=
GetDeviceCaps
(
hdc
,
HORZRES
);
...
...
@@ -177,34 +181,34 @@ INT WINAPI SetMapMode( HDC hdc, INT mode )
break
;
case
MM_LOMETRIC
:
case
MM_ISOTROPIC
:
dc
->
wndExtX
=
horzSize
;
dc
->
wndExtY
=
vertSize
;
dc
->
vportExtX
=
horzRes
/
10
;
dc
->
vportExtY
=
vertRes
/
-
10
;
break
;
case
MM_HIMETRIC
:
dc
->
wndExtX
=
horzSize
*
10
;
dc
->
wndExtY
=
vertSize
*
10
;
dc
->
vportExtX
=
horzRes
/
10
;
dc
->
vportExtY
=
vertRes
/
-
10
;
dc
->
vportExtX
=
horzRes
;
dc
->
vportExtY
=
-
vertRes
;
break
;
case
MM_HIMETRIC
:
dc
->
wndExtX
=
horzSize
*
100
;
dc
->
wndExtY
=
vertSize
*
100
;
dc
->
vportExtX
=
horzRes
;
dc
->
vportExtY
=
-
vertRes
;
break
;
case
MM_LOENGLISH
:
dc
->
wndExtX
=
horzSize
;
dc
->
wndExtY
=
vertSize
;
dc
->
vportExtX
=
254L
*
horzRes
/
1000
;
dc
->
vportExtY
=
-
254L
*
vertRes
/
1000
;
dc
->
wndExtX
=
MulDiv
(
1000
,
horzSize
,
254
)
;
dc
->
wndExtY
=
MulDiv
(
1000
,
vertSize
,
254
)
;
dc
->
vportExtX
=
horzRes
;
dc
->
vportExtY
=
-
vertRes
;
break
;
case
MM_HIENGLISH
:
dc
->
wndExtX
=
horzSize
*
10
;
dc
->
wndExtY
=
vertSize
*
10
;
dc
->
vportExtX
=
254L
*
horzRes
/
1000
;
dc
->
vportExtY
=
-
254L
*
vertRes
/
1000
;
dc
->
wndExtX
=
MulDiv
(
10000
,
horzSize
,
254
)
;
dc
->
wndExtY
=
MulDiv
(
10000
,
vertSize
,
254
)
;
dc
->
vportExtX
=
horzRes
;
dc
->
vportExtY
=
-
vertRes
;
break
;
case
MM_TWIPS
:
dc
->
wndExtX
=
144L
*
horzSize
/
10
;
dc
->
wndExtY
=
144L
*
vertSize
/
10
;
dc
->
vportExtX
=
254L
*
horzRes
/
1000
;
dc
->
vportExtY
=
-
254L
*
vertRes
/
1000
;
dc
->
wndExtX
=
MulDiv
(
14400
,
horzSize
,
254
)
;
dc
->
wndExtY
=
MulDiv
(
14400
,
vertSize
,
254
)
;
dc
->
vportExtX
=
horzRes
;
dc
->
vportExtY
=
-
vertRes
;
break
;
case
MM_ANISOTROPIC
:
break
;
...
...
@@ -321,7 +325,7 @@ BOOL WINAPI SetWindowExtEx( HDC hdc, INT x, INT y, LPSIZE size )
}
dc
->
wndExtX
=
x
;
dc
->
wndExtY
=
y
;
if
(
dc
->
MapMode
==
MM_ISOTROPIC
)
MAPPING_FixIsotropic
(
dc
);
/* Windows fixes MM_ISOTROPIC mode only in SetViewportExtEx() */
DC_UpdateXforms
(
dc
);
done:
GDI_ReleaseObj
(
hdc
);
...
...
objects/enhmetafile.c
View file @
e8e10e9a
...
...
@@ -360,34 +360,34 @@ void EMF_SetMapMode(HDC hdc, enum_emh_data *info)
break
;
case
MM_LOMETRIC
:
case
MM_ISOTROPIC
:
info
->
wndExtX
=
horzSize
;
info
->
wndExtY
=
vertSize
;
info
->
vportExtX
=
horzRes
/
10
;
info
->
vportExtY
=
vertRes
/
-
10
;
break
;
case
MM_HIMETRIC
:
info
->
wndExtX
=
horzSize
*
10
;
info
->
wndExtY
=
vertSize
*
10
;
info
->
vportExtX
=
horzRes
/
10
;
info
->
vportExtY
=
vertRes
/
-
10
;
info
->
vportExtX
=
horzRes
;
info
->
vportExtY
=
-
vertRes
;
break
;
case
MM_HIMETRIC
:
info
->
wndExtX
=
horzSize
*
100
;
info
->
wndExtY
=
vertSize
*
100
;
info
->
vportExtX
=
horzRes
;
info
->
vportExtY
=
-
vertRes
;
break
;
case
MM_LOENGLISH
:
info
->
wndExtX
=
horzSize
;
info
->
wndExtY
=
vertSize
;
info
->
vportExtX
=
254L
*
horzRes
/
1000
;
info
->
vportExtY
=
-
254L
*
vertRes
/
1000
;
info
->
wndExtX
=
MulDiv
(
1000
,
horzSize
,
254
)
;
info
->
wndExtY
=
MulDiv
(
1000
,
vertSize
,
254
)
;
info
->
vportExtX
=
horzRes
;
info
->
vportExtY
=
-
vertRes
;
break
;
case
MM_HIENGLISH
:
info
->
wndExtX
=
horzSize
*
10
;
info
->
wndExtY
=
vertSize
*
10
;
info
->
vportExtX
=
254L
*
horzRes
/
1000
;
info
->
vportExtY
=
-
254L
*
vertRes
/
1000
;
info
->
wndExtX
=
MulDiv
(
10000
,
horzSize
,
254
)
;
info
->
wndExtY
=
MulDiv
(
10000
,
vertSize
,
254
)
;
info
->
vportExtX
=
horzRes
;
info
->
vportExtY
=
-
vertRes
;
break
;
case
MM_TWIPS
:
info
->
wndExtX
=
144L
*
horzSize
/
10
;
info
->
wndExtY
=
144L
*
vertSize
/
10
;
info
->
vportExtX
=
254L
*
horzRes
/
1000
;
info
->
vportExtY
=
-
254L
*
vertRes
/
1000
;
info
->
wndExtX
=
MulDiv
(
14400
,
horzSize
,
254
)
;
info
->
wndExtY
=
MulDiv
(
14400
,
vertSize
,
254
)
;
info
->
vportExtX
=
horzRes
;
info
->
vportExtY
=
-
vertRes
;
break
;
case
MM_ANISOTROPIC
:
break
;
...
...
@@ -516,7 +516,7 @@ BOOL WINAPI PlayEnhMetaFileRecord(
{
PEMRSETMAPMODE
pSetMapMode
=
(
PEMRSETMAPMODE
)
mr
;
if
(
info
->
mode
==
pSetMapMode
->
iMode
)
if
(
info
->
mode
==
pSetMapMode
->
iMode
&&
(
info
->
mode
==
MM_ISOTROPIC
||
info
->
mode
==
MM_ANISOTROPIC
)
)
break
;
info
->
mode
=
pSetMapMode
->
iMode
;
EMF_SetMapMode
(
hdc
,
info
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment