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
97a261d5
Commit
97a261d5
authored
Oct 26, 2011
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdi32: Avoid directly modifying the cursor position in the DC structure in PolyDraw.
parent
da6363e3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
43 additions
and
48 deletions
+43
-48
path.c
dlls/gdi32/path.c
+43
-48
No files found.
dlls/gdi32/path.c
View file @
97a261d5
...
...
@@ -1199,63 +1199,58 @@ BOOL PATH_PolyBezier(DC *dc, const POINT *pts, DWORD cbPoints)
BOOL
PATH_PolyDraw
(
DC
*
dc
,
const
POINT
*
pts
,
const
BYTE
*
types
,
DWORD
cbPoints
)
{
GdiPath
*
pPath
=
&
dc
->
path
;
POINT
lastmove
,
orig_pos
;
INT
i
;
lastmove
.
x
=
orig_pos
.
x
=
dc
->
CursPosX
;
lastmove
.
y
=
orig_pos
.
y
=
dc
->
CursPosY
;
for
(
i
=
pPath
->
numEntriesUsed
-
1
;
i
>=
0
;
i
--
){
if
(
pPath
->
pFlags
[
i
]
==
PT_MOVETO
){
lastmove
.
x
=
pPath
->
pPoints
[
i
].
x
;
lastmove
.
y
=
pPath
->
pPoints
[
i
].
y
;
if
(
!
DPtoLP
(
dc
->
hSelf
,
&
lastmove
,
1
))
return
FALSE
;
break
;
}
GdiPath
*
pPath
=
&
dc
->
path
;
POINT
lastmove
,
orig_pos
;
INT
i
;
GetCurrentPositionEx
(
dc
->
hSelf
,
&
orig_pos
);
lastmove
=
orig_pos
;
for
(
i
=
pPath
->
numEntriesUsed
-
1
;
i
>=
0
;
i
--
){
if
(
pPath
->
pFlags
[
i
]
==
PT_MOVETO
){
lastmove
=
pPath
->
pPoints
[
i
];
DPtoLP
(
dc
->
hSelf
,
&
lastmove
,
1
);
break
;
}
}
for
(
i
=
0
;
i
<
cbPoints
;
i
++
){
if
(
types
[
i
]
==
PT_MOVETO
){
pPath
->
newStroke
=
TRUE
;
lastmove
.
x
=
pts
[
i
].
x
;
lastmove
.
y
=
pts
[
i
].
y
;
}
else
if
((
types
[
i
]
&
~
PT_CLOSEFIGURE
)
==
PT_LINETO
){
PATH_LineTo
(
dc
,
pts
[
i
].
x
,
pts
[
i
].
y
);
}
else
if
(
types
[
i
]
==
PT_BEZIERTO
){
if
(
!
((
i
+
2
<
cbPoints
)
&&
(
types
[
i
+
1
]
==
PT_BEZIERTO
)
&&
((
types
[
i
+
2
]
&
~
PT_CLOSEFIGURE
)
==
PT_BEZIERTO
)))
goto
err
;
PATH_PolyBezierTo
(
dc
,
&
(
pts
[
i
]),
3
);
for
(
i
=
0
;
i
<
cbPoints
;
i
++
)
{
switch
(
types
[
i
])
{
case
PT_MOVETO
:
MoveToEx
(
dc
->
hSelf
,
pts
[
i
].
x
,
pts
[
i
].
y
,
NULL
);
break
;
case
PT_LINETO
:
case
PT_LINETO
|
PT_CLOSEFIGURE
:
LineTo
(
dc
->
hSelf
,
pts
[
i
].
x
,
pts
[
i
].
y
);
break
;
case
PT_BEZIERTO
:
if
((
i
+
2
<
cbPoints
)
&&
(
types
[
i
+
1
]
==
PT_BEZIERTO
)
&&
(
types
[
i
+
2
]
&
~
PT_CLOSEFIGURE
)
==
PT_BEZIERTO
)
{
PolyBezierTo
(
dc
->
hSelf
,
&
pts
[
i
],
3
);
i
+=
2
;
break
;
}
else
goto
err
;
dc
->
CursPosX
=
pts
[
i
].
x
;
dc
->
CursPosY
=
pts
[
i
].
y
;
if
(
types
[
i
]
&
PT_CLOSEFIGURE
){
pPath
->
pFlags
[
pPath
->
numEntriesUsed
-
1
]
|=
PT_CLOSEFIGURE
;
pPath
->
newStroke
=
TRUE
;
dc
->
CursPosX
=
lastmove
.
x
;
dc
->
CursPosY
=
lastmove
.
y
;
/* fall through */
default:
if
(
i
)
/* restore original position */
{
if
(
!
(
types
[
i
-
1
]
&
PT_CLOSEFIGURE
))
lastmove
=
pts
[
i
-
1
];
if
(
lastmove
.
x
!=
orig_pos
.
x
||
lastmove
.
y
!=
orig_pos
.
y
)
MoveToEx
(
dc
->
hSelf
,
orig_pos
.
x
,
orig_pos
.
y
,
NULL
);
}
return
FALSE
;
}
return
TRUE
;
err:
if
((
dc
->
CursPosX
!=
orig_pos
.
x
)
||
(
dc
->
CursPosY
!=
orig_pos
.
y
)){
pPath
->
newStroke
=
TRUE
;
dc
->
CursPosX
=
orig_pos
.
x
;
dc
->
CursPosY
=
orig_pos
.
y
;
if
(
types
[
i
]
&
PT_CLOSEFIGURE
){
pPath
->
pFlags
[
pPath
->
numEntriesUsed
-
1
]
|=
PT_CLOSEFIGURE
;
MoveToEx
(
dc
->
hSelf
,
lastmove
.
x
,
lastmove
.
y
,
NULL
);
}
}
return
FALS
E
;
return
TRU
E
;
}
BOOL
PATH_Polyline
(
DC
*
dc
,
const
POINT
*
pts
,
DWORD
cbPoints
)
...
...
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