Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
6e05189b
Commit
6e05189b
authored
Mar 09, 2016
by
Huw Davies
Committed by
Alexandre Julliard
Mar 09, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdi32: Don't update the bounds if any poly{line|gon} has fewer than two points.
Signed-off-by:
Huw Davies
<
huw@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
2e4a37f2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
10 deletions
+23
-10
graphics.c
dlls/gdi32/enhmfdrv/graphics.c
+23
-10
No files found.
dlls/gdi32/enhmfdrv/graphics.c
View file @
6e05189b
...
...
@@ -484,28 +484,33 @@ EMFDRV_PolyPolylinegon( PHYSDEV dev, const POINT* pt, const INT* counts, UINT po
EMRPOLYPOLYLINE
*
emr
;
DWORD
cptl
=
0
,
poly
,
size
,
i
;
INT
point
;
RECTL
bounds
;
const
RECTL
empty
=
{
0
,
0
,
-
1
,
-
1
};
RECTL
bounds
=
empty
;
const
POINT
*
pts
;
BOOL
ret
,
use_small_emr
=
TRUE
;
bounds
.
left
=
bounds
.
right
=
pt
[
0
].
x
;
bounds
.
top
=
bounds
.
bottom
=
pt
[
0
].
y
;
BOOL
ret
,
use_small_emr
=
TRUE
,
bounds_valid
=
TRUE
;
pts
=
pt
;
for
(
poly
=
0
;
poly
<
polys
;
poly
++
)
{
cptl
+=
counts
[
poly
];
if
(
counts
[
poly
]
<
2
)
bounds_valid
=
FALSE
;
for
(
point
=
0
;
point
<
counts
[
poly
];
point
++
)
{
/* check whether all points fit in the SHORT int POINT structure */
if
(
((
pts
->
x
+
0x8000
)
&
~
0xffff
)
||
((
pts
->
y
+
0x8000
)
&
~
0xffff
)
)
use_small_emr
=
FALSE
;
if
(
bounds
.
left
>
pts
->
x
)
bounds
.
left
=
pts
->
x
;
else
if
(
bounds
.
right
<
pts
->
x
)
bounds
.
right
=
pts
->
x
;
if
(
bounds
.
top
>
pts
->
y
)
bounds
.
top
=
pts
->
y
;
else
if
(
bounds
.
bottom
<
pts
->
y
)
bounds
.
bottom
=
pts
->
y
;
if
(
pts
==
pt
)
{
bounds
.
left
=
bounds
.
right
=
pts
->
x
;
bounds
.
top
=
bounds
.
bottom
=
pts
->
y
;
}
else
{
if
(
bounds
.
left
>
pts
->
x
)
bounds
.
left
=
pts
->
x
;
else
if
(
bounds
.
right
<
pts
->
x
)
bounds
.
right
=
pts
->
x
;
if
(
bounds
.
top
>
pts
->
y
)
bounds
.
top
=
pts
->
y
;
else
if
(
bounds
.
bottom
<
pts
->
y
)
bounds
.
bottom
=
pts
->
y
;
}
pts
++
;
}
}
if
(
!
cptl
)
bounds_valid
=
FALSE
;
size
=
FIELD_OFFSET
(
EMRPOLYPOLYLINE
,
aPolyCounts
[
polys
]);
if
(
use_small_emr
)
...
...
@@ -519,7 +524,10 @@ EMFDRV_PolyPolylinegon( PHYSDEV dev, const POINT* pt, const INT* counts, UINT po
if
(
use_small_emr
)
emr
->
emr
.
iType
+=
EMR_POLYPOLYLINE16
-
EMR_POLYPOLYLINE
;
emr
->
emr
.
nSize
=
size
;
emr
->
rclBounds
=
bounds
;
if
(
bounds_valid
)
emr
->
rclBounds
=
bounds
;
else
emr
->
rclBounds
=
empty
;
emr
->
nPolys
=
polys
;
emr
->
cptl
=
cptl
;
...
...
@@ -543,6 +551,11 @@ EMFDRV_PolyPolylinegon( PHYSDEV dev, const POINT* pt, const INT* counts, UINT po
}
ret
=
EMFDRV_WriteRecord
(
dev
,
&
emr
->
emr
);
if
(
ret
&&
!
bounds_valid
)
{
ret
=
FALSE
;
SetLastError
(
ERROR_INVALID_PARAMETER
);
}
if
(
ret
)
EMFDRV_UpdateBBox
(
dev
,
&
emr
->
rclBounds
);
HeapFree
(
GetProcessHeap
(),
0
,
emr
);
...
...
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