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
8cb17012
Commit
8cb17012
authored
Feb 09, 2009
by
Nikolay Sivov
Committed by
Alexandre Julliard
Feb 10, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdiplus: Handle zero width/height in GdipAddPathPie.
parent
2e29c7d5
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
1 deletion
+31
-1
graphicspath.c
dlls/gdiplus/graphicspath.c
+11
-0
graphicspath.c
dlls/gdiplus/tests/graphicspath.c
+20
-1
No files found.
dlls/gdiplus/graphicspath.c
View file @
8cb17012
...
...
@@ -723,6 +723,17 @@ GpStatus WINGDIPAPI GdipAddPathPie(GpPath *path, REAL x, REAL y, REAL width, REA
if
(
!
path
)
return
InvalidParameter
;
/* on zero width/height only start point added */
if
(
width
<=
1e-7
||
height
<=
1e-7
){
if
(
!
lengthen_path
(
path
,
1
))
return
OutOfMemory
;
path
->
pathdata
.
Points
[
0
].
X
=
x
+
width
/
2
.
0
;
path
->
pathdata
.
Points
[
0
].
Y
=
y
+
height
/
2
.
0
;
path
->
pathdata
.
Types
[
0
]
=
PathPointTypeStart
|
PathPointTypeCloseSubpath
;
path
->
pathdata
.
Count
=
1
;
return
InvalidParameter
;
}
count
=
arc2polybezier
(
NULL
,
x
,
y
,
width
,
height
,
startAngle
,
sweepAngle
);
if
(
count
==
0
)
...
...
dlls/gdiplus/tests/graphicspath.c
View file @
8cb17012
...
...
@@ -907,7 +907,12 @@ static path_test_t addpie_path[] = {
{
79
.
4
,
46
.
8
,
PathPointTypeBezier
,
0
,
0
},
/*3*/
{
63
.
9
,
49
.
0
,
PathPointTypeBezier
|
PathPointTypeCloseSubpath
,
0
,
0
}
/*4*/
};
static
path_test_t
addpie_path2
[]
=
{
{
0
.
0
,
30
.
0
,
PathPointTypeStart
|
PathPointTypeCloseSubpath
,
0
,
0
}
/*0*/
};
static
path_test_t
addpie_path3
[]
=
{
{
30
.
0
,
0
.
0
,
PathPointTypeStart
|
PathPointTypeCloseSubpath
,
0
,
0
}
/*0*/
};
static
void
test_addpie
(
void
)
{
GpStatus
status
;
...
...
@@ -922,6 +927,20 @@ static void test_addpie(void)
status
=
GdipAddPathPie
(
path
,
0
.
0
,
0
.
0
,
100
.
0
,
50
.
0
,
10
.
0
,
50
.
0
);
expect
(
Ok
,
status
);
ok_path
(
path
,
addpie_path
,
sizeof
(
addpie_path
)
/
sizeof
(
path_test_t
),
FALSE
);
status
=
GdipResetPath
(
path
);
expect
(
Ok
,
status
);
/* zero width base ellipse */
status
=
GdipAddPathPie
(
path
,
0
.
0
,
0
.
0
,
0
.
0
,
60
.
0
,
-
90
.
0
,
24
.
0
);
expect
(
InvalidParameter
,
status
);
ok_path
(
path
,
addpie_path2
,
sizeof
(
addpie_path2
)
/
sizeof
(
path_test_t
),
FALSE
);
status
=
GdipResetPath
(
path
);
expect
(
Ok
,
status
);
/* zero height base ellipse */
status
=
GdipAddPathPie
(
path
,
0
.
0
,
0
.
0
,
60
.
0
,
0
.
0
,
-
90
.
0
,
24
.
0
);
expect
(
InvalidParameter
,
status
);
ok_path
(
path
,
addpie_path3
,
sizeof
(
addpie_path3
)
/
sizeof
(
path_test_t
),
FALSE
);
GdipDeletePath
(
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