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
eddc1275
Commit
eddc1275
authored
Nov 14, 2008
by
Vincent Povirk
Committed by
Alexandre Julliard
Nov 17, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdiplus: Fix GdipFlattenPath for already-flat paths and add a test.
parent
025daaf0
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
3 deletions
+15
-3
graphicspath.c
dlls/gdiplus/graphicspath.c
+2
-3
graphicspath.c
dlls/gdiplus/tests/graphicspath.c
+13
-0
No files found.
dlls/gdiplus/graphicspath.c
View file @
eddc1275
...
...
@@ -984,17 +984,16 @@ GpStatus WINGDIPAPI GdipFlattenPath(GpPath *path, GpMatrix* matrix, REAL flatnes
/* always add line points and start points */
if
((
type
==
PathPointTypeStart
)
||
(
type
==
PathPointTypeLine
)){
type
=
(
path
->
pathdata
.
Types
[
i
]
&
~
PathPointTypeBezier
)
|
PathPointTypeLine
;
if
(
!
add_path_list_node
(
node
,
pt
.
X
,
pt
.
Y
,
type
))
if
(
!
add_path_list_node
(
node
,
pt
.
X
,
pt
.
Y
,
path
->
pathdata
.
Types
[
i
]))
goto
memout
;
node
=
node
->
next
;
++
i
;
continue
;
}
/* Bezier curve always stored as 4 points */
if
((
path
->
pathdata
.
Types
[
i
-
1
]
&
PathPointTypePathTypeMask
)
!=
PathPointTypeStart
){
type
=
(
path
->
pathdata
.
Types
[
i
]
&
~
PathPointTypeBezier
)
|
PathPointTypeLine
;
if
(
!
add_path_list_node
(
node
,
pt
.
X
,
pt
.
Y
,
type
))
goto
memout
;
...
...
dlls/gdiplus/tests/graphicspath.c
View file @
eddc1275
...
...
@@ -914,6 +914,11 @@ static path_test_t flattenellipse_path[] = {
{
100
.
0
,
25
.
0
,
PathPointTypeLine
|
PathPointTypeCloseSubpath
,
0
,
1
}
/*24*/
};
static
path_test_t
flattenline_path
[]
=
{
{
5
.
0
,
10
.
0
,
PathPointTypeStart
,
0
,
0
},
/*0*/
{
50
.
0
,
100
.
0
,
PathPointTypeLine
,
0
,
0
}
/*1*/
};
static
path_test_t
flattenarc_path
[]
=
{
{
100
.
0
,
25
.
0
,
PathPointTypeStart
,
0
,
0
},
/*0*/
{
99
.
0
,
30
.
0
,
PathPointTypeLine
,
0
,
0
},
/*1*/
...
...
@@ -966,6 +971,14 @@ static void test_flatten(void)
status
=
GdipResetPath
(
path
);
expect
(
Ok
,
status
);
status
=
GdipAddPathLine
(
path
,
5
.
0
,
10
.
0
,
50
.
0
,
100
.
0
);
expect
(
Ok
,
status
);
status
=
GdipFlattenPath
(
path
,
NULL
,
1
.
0
);
expect
(
Ok
,
status
);
ok_path
(
path
,
flattenline_path
,
sizeof
(
flattenline_path
)
/
sizeof
(
path_test_t
),
FALSE
);
status
=
GdipResetPath
(
path
);
expect
(
Ok
,
status
);
status
=
GdipAddPathArc
(
path
,
0
.
0
,
0
.
0
,
100
.
0
,
50
.
0
,
0
.
0
,
90
.
0
);
expect
(
Ok
,
status
);
status
=
GdipFlattenPath
(
path
,
NULL
,
1
.
0
);
...
...
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