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
9e88347f
Commit
9e88347f
authored
Jul 13, 2007
by
Evan Stade
Committed by
Alexandre Julliard
Jul 16, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdiplus: Simplified GdipDrawPath by moving more of the code to the helpers.
parent
d13e1ba0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
48 additions
and
54 deletions
+48
-54
graphics.c
dlls/gdiplus/graphics.c
+48
-54
No files found.
dlls/gdiplus/graphics.c
View file @
9e88347f
...
...
@@ -466,52 +466,60 @@ static GpStatus draw_poly(HDC hdc, GpPen *pen, GDIPCONST GpPointF * pt,
ERR
(
"Bad bezier points
\n
"
);
goto
end
;
}
i
+=
2
;
}
}
if
((
types
[
count
-
1
]
&
PathPointTypePathTypeMask
)
==
PathPointTypeBezier
){
ptf
=
GdipAlloc
(
4
*
sizeof
(
GpPointF
));
memcpy
(
ptf
,
&
pt
[
count
-
4
],
4
*
sizeof
(
GpPointF
));
for
(
i
=
0
;
i
<
count
;
i
++
){
pti
[
i
].
x
=
roundr
(
pt
[
i
].
X
);
pti
[
i
].
y
=
roundr
(
pt
[
i
].
Y
);
}
if
(
caps
){
if
(
pen
->
endcap
==
LineCapArrowAnchor
)
shorten_bezier_amt
(
ptf
,
pen
->
width
);
/* If we are drawing caps, go through the points and adjust them accordingly,
* and draw the caps. */
if
(
caps
){
switch
(
types
[
count
-
1
]
&
PathPointTypePathTypeMask
){
case
PathPointTypeBezier
:
ptf
=
GdipAlloc
(
4
*
sizeof
(
GpPointF
));
if
(
!
ptf
){
status
=
OutOfMemory
;
goto
end
;
}
memcpy
(
ptf
,
&
pt
[
count
-
4
],
4
*
sizeof
(
GpPointF
));
draw_cap
(
hdc
,
pen
->
color
,
pen
->
endcap
,
pen
->
width
,
pt
[
count
-
1
].
X
-
(
ptf
[
3
].
X
-
ptf
[
2
].
X
),
pt
[
count
-
1
].
Y
-
(
ptf
[
3
].
Y
-
ptf
[
2
].
Y
),
pt
[
count
-
1
].
X
,
pt
[
count
-
1
].
Y
);
}
for
(
i
=
0
;
i
<
4
;
i
++
){
pti
[
i
+
count
-
4
].
x
=
roundr
(
ptf
[
i
].
X
);
pti
[
i
+
count
-
4
].
y
=
roundr
(
ptf
[
i
].
Y
);
}
for
(
i
=
0
;
i
<
count
-
4
;
i
++
){
pti
[
i
].
x
=
roundr
(
pt
[
i
].
X
);
pti
[
i
].
y
=
roundr
(
pt
[
i
].
Y
);
}
}
else
if
((
types
[
count
-
1
]
&
PathPointTypePathTypeMask
)
==
PathPointTypeLine
){
if
(
caps
){
if
(
pen
->
endcap
==
LineCapArrowAnchor
)
shorten_line_amt
(
pt
[
count
-
2
].
X
,
pt
[
count
-
2
].
Y
,
&
x
,
&
y
,
pen
->
width
);
if
(
pen
->
endcap
==
LineCapArrowAnchor
)
shorten_bezier_amt
(
ptf
,
pen
->
width
);
draw_cap
(
hdc
,
pen
->
color
,
pen
->
endcap
,
pen
->
width
,
pt
[
count
-
2
].
X
,
pt
[
count
-
2
].
Y
,
pt
[
count
-
1
].
X
,
pt
[
count
-
1
].
Y
);
}
pti
[
count
-
1
].
x
=
roundr
(
x
);
pti
[
count
-
1
].
y
=
roundr
(
y
);
for
(
i
=
0
;
i
<
count
-
1
;
i
++
){
pti
[
i
].
x
=
roundr
(
pt
[
i
].
X
);
pti
[
i
].
y
=
roundr
(
pt
[
i
].
Y
);
draw_cap
(
hdc
,
pen
->
color
,
pen
->
endcap
,
pen
->
width
,
pt
[
count
-
1
].
X
-
(
ptf
[
3
].
X
-
ptf
[
2
].
X
),
pt
[
count
-
1
].
Y
-
(
ptf
[
3
].
Y
-
ptf
[
2
].
Y
),
pt
[
count
-
1
].
X
,
pt
[
count
-
1
].
Y
);
for
(
i
=
0
;
i
<
4
;
i
++
){
pti
[
i
+
count
-
4
].
x
=
roundr
(
ptf
[
i
].
X
);
pti
[
i
+
count
-
4
].
y
=
roundr
(
ptf
[
i
].
Y
);
}
break
;
case
PathPointTypeLine
:
if
(
pen
->
endcap
==
LineCapArrowAnchor
)
shorten_line_amt
(
pt
[
count
-
2
].
X
,
pt
[
count
-
2
].
Y
,
&
x
,
&
y
,
pen
->
width
);
draw_cap
(
hdc
,
pen
->
color
,
pen
->
endcap
,
pen
->
width
,
pt
[
count
-
2
].
X
,
pt
[
count
-
2
].
Y
,
pt
[
count
-
1
].
X
,
pt
[
count
-
1
].
Y
);
pti
[
count
-
1
].
x
=
roundr
(
x
);
pti
[
count
-
1
].
y
=
roundr
(
y
);
break
;
default:
ERR
(
"Bad path last point
\n
"
);
goto
end
;
}
}
else
{
ERR
(
"Bad path last point
\n
"
);
goto
end
;
}
for
(
i
=
0
;
i
<
count
;
i
++
){
tp
[
i
]
=
convert_path_point_type
(
types
[
i
]);
...
...
@@ -729,7 +737,7 @@ GpStatus WINGDIPAPI GdipDrawLines(GpGraphics *graphics, GpPen *pen, GDIPCONST
GpStatus
WINGDIPAPI
GdipDrawPath
(
GpGraphics
*
graphics
,
GpPen
*
pen
,
GpPath
*
path
)
{
INT
save_state
,
i
,
this_fig
=
0
;
INT
save_state
;
GpStatus
retval
;
if
(
!
pen
||
!
graphics
)
...
...
@@ -739,23 +747,9 @@ GpStatus WINGDIPAPI GdipDrawPath(GpGraphics *graphics, GpPen *pen, GpPath *path)
EndPath
(
graphics
->
hdc
);
SelectObject
(
graphics
->
hdc
,
pen
->
gdipen
);
for
(
i
=
0
;
i
<
path
->
pathdata
.
Count
;
i
++
){
if
(
path
->
pathdata
.
Types
[
i
]
==
PathPointTypeStart
){
retval
=
draw_poly
(
graphics
->
hdc
,
pen
,
&
path
->
pathdata
.
Points
[
this_fig
],
&
path
->
pathdata
.
Types
[
this_fig
],
i
-
this_fig
,
TRUE
);
this_fig
=
i
;
retval
=
draw_poly
(
graphics
->
hdc
,
pen
,
path
->
pathdata
.
Points
,
path
->
pathdata
.
Types
,
path
->
pathdata
.
Count
,
TRUE
);
if
(
retval
!=
Ok
)
goto
end
;
}
}
retval
=
draw_poly
(
graphics
->
hdc
,
pen
,
&
path
->
pathdata
.
Points
[
this_fig
],
&
path
->
pathdata
.
Types
[
this_fig
],
path
->
pathdata
.
Count
-
this_fig
,
TRUE
);
end:
RestoreDC
(
graphics
->
hdc
,
save_state
);
return
retval
;
...
...
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