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
6f4ab528
Commit
6f4ab528
authored
Jul 11, 2007
by
Evan Stade
Committed by
Alexandre Julliard
Jul 12, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdiplus: Added draw_polyline error checking.
parent
fa31217d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
6 deletions
+23
-6
graphics.c
dlls/gdiplus/graphics.c
+23
-6
No files found.
dlls/gdiplus/graphics.c
View file @
6f4ab528
...
...
@@ -282,12 +282,23 @@ static void shorten_line_amt(REAL x1, REAL y1, REAL *x2, REAL *y2, REAL amt)
/* Draws lines between the given points, and if caps is true then draws an endcap
* at the end of the last line. FIXME: Startcaps not implemented. */
static
void
draw_polyline
(
HDC
hdc
,
GpPen
*
pen
,
GDIPCONST
GpPointF
*
pt
,
static
GpStatus
draw_polyline
(
HDC
hdc
,
GpPen
*
pen
,
GDIPCONST
GpPointF
*
pt
,
INT
count
,
BOOL
caps
)
{
POINT
*
pti
=
GdipAlloc
(
count
*
sizeof
(
POINT
))
;
POINT
*
pti
;
REAL
x
=
pt
[
count
-
1
].
X
,
y
=
pt
[
count
-
1
].
Y
;
INT
i
;
GpStatus
status
=
GenericError
;
if
(
!
count
)
return
Ok
;
pti
=
GdipAlloc
(
count
*
sizeof
(
POINT
));
if
(
!
pti
){
status
=
OutOfMemory
;
goto
end
;
}
if
(
caps
){
if
(
pen
->
endcap
==
LineCapArrowAnchor
)
...
...
@@ -306,7 +317,11 @@ static void draw_polyline(HDC hdc, GpPen *pen, GDIPCONST GpPointF * pt,
pti
[
i
].
y
=
roundr
(
y
);
Polyline
(
hdc
,
pti
,
count
);
end:
GdipFree
(
pti
);
return
status
;
}
/* Conducts a linear search to find the bezier points that will back off
...
...
@@ -660,6 +675,7 @@ GpStatus WINGDIPAPI GdipDrawLineI(GpGraphics *graphics, GpPen *pen, INT x1,
{
INT
save_state
;
GpPointF
pt
[
2
];
GpStatus
retval
;
if
(
!
pen
||
!
graphics
)
return
InvalidParameter
;
...
...
@@ -673,17 +689,18 @@ GpStatus WINGDIPAPI GdipDrawLineI(GpGraphics *graphics, GpPen *pen, INT x1,
EndPath
(
graphics
->
hdc
);
SelectObject
(
graphics
->
hdc
,
pen
->
gdipen
);
draw_polyline
(
graphics
->
hdc
,
pen
,
pt
,
2
,
TRUE
);
retval
=
draw_polyline
(
graphics
->
hdc
,
pen
,
pt
,
2
,
TRUE
);
RestoreDC
(
graphics
->
hdc
,
save_state
);
return
Ok
;
return
retval
;
}
GpStatus
WINGDIPAPI
GdipDrawLines
(
GpGraphics
*
graphics
,
GpPen
*
pen
,
GDIPCONST
GpPointF
*
points
,
INT
count
)
{
INT
save_state
;
GpStatus
retval
;
if
(
!
pen
||
!
graphics
||
(
count
<
2
))
return
InvalidParameter
;
...
...
@@ -692,11 +709,11 @@ GpStatus WINGDIPAPI GdipDrawLines(GpGraphics *graphics, GpPen *pen, GDIPCONST
EndPath
(
graphics
->
hdc
);
SelectObject
(
graphics
->
hdc
,
pen
->
gdipen
);
draw_polyline
(
graphics
->
hdc
,
pen
,
points
,
count
,
TRUE
);
retval
=
draw_polyline
(
graphics
->
hdc
,
pen
,
points
,
count
,
TRUE
);
RestoreDC
(
graphics
->
hdc
,
save_state
);
return
Ok
;
return
retval
;
}
GpStatus
WINGDIPAPI
GdipDrawPath
(
GpGraphics
*
graphics
,
GpPen
*
pen
,
GpPath
*
path
)
...
...
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