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
09c96907
Commit
09c96907
authored
Oct 28, 2023
by
Bartosz Kosiorek
Committed by
Alexandre Julliard
Oct 31, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdiplus: Fix GdipAddPathCurve3 curve calculation with offset and nseg variables.
parent
f850488d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
12 deletions
+24
-12
graphicspath.c
dlls/gdiplus/graphicspath.c
+20
-8
graphicspath.c
dlls/gdiplus/tests/graphicspath.c
+4
-4
No files found.
dlls/gdiplus/graphicspath.c
View file @
09c96907
...
...
@@ -562,15 +562,23 @@ GpStatus WINGDIPAPI GdipAddPathCurve3(GpPath *path, GDIPCONST GpPointF *points,
tension
=
tension
*
TENSION_CONST
;
calc_curve_bezier_endp
(
points
[
offset
].
X
,
points
[
offset
].
Y
,
points
[
offset
+
1
].
X
,
points
[
offset
+
1
].
Y
,
tension
,
&
x1
,
&
y1
);
pt
[
0
].
X
=
points
[
offset
].
X
;
pt
[
0
].
Y
=
points
[
offset
].
Y
;
pt
[
1
].
X
=
x1
;
pt
[
1
].
Y
=
y1
;
if
(
offset
>
0
)
{
calc_curve_bezier
(
&
(
points
[
offset
-
1
]),
tension
,
&
x1
,
&
y1
,
&
x2
,
&
y2
);
pt
[
1
].
X
=
x2
;
pt
[
1
].
Y
=
y2
;
}
else
{
calc_curve_bezier_endp
(
points
[
offset
].
X
,
points
[
offset
].
Y
,
points
[
offset
+
1
].
X
,
points
[
offset
+
1
].
Y
,
tension
,
&
x1
,
&
y1
);
pt
[
1
].
X
=
x1
;
pt
[
1
].
Y
=
y1
;
}
for
(
i
=
0
;
i
<
nseg
-
1
;
i
++
){
for
(
i
=
0
;
i
<
nseg
-
1
;
i
++
){
calc_curve_bezier
(
&
(
points
[
offset
+
i
]),
tension
,
&
x1
,
&
y1
,
&
x2
,
&
y2
);
pt
[
3
*
i
+
2
].
X
=
x1
;
...
...
@@ -581,8 +589,12 @@ GpStatus WINGDIPAPI GdipAddPathCurve3(GpPath *path, GDIPCONST GpPointF *points,
pt
[
3
*
i
+
4
].
Y
=
y2
;
}
calc_curve_bezier_endp
(
points
[
offset
+
nseg
].
X
,
points
[
offset
+
nseg
].
Y
,
points
[
offset
+
nseg
-
1
].
X
,
points
[
offset
+
nseg
-
1
].
Y
,
tension
,
&
x1
,
&
y1
);
if
(
offset
+
nseg
+
1
<
count
)
/* If there are one more point in points table then use it for curve calculation */
calc_curve_bezier
(
&
(
points
[
offset
+
nseg
-
1
]),
tension
,
&
x1
,
&
y1
,
&
x2
,
&
y2
);
else
calc_curve_bezier_endp
(
points
[
offset
+
nseg
].
X
,
points
[
offset
+
nseg
].
Y
,
points
[
offset
+
nseg
-
1
].
X
,
points
[
offset
+
nseg
-
1
].
Y
,
tension
,
&
x1
,
&
y1
);
pt
[
len_pt
-
2
].
X
=
x1
;
pt
[
len_pt
-
2
].
Y
=
y1
;
...
...
dlls/gdiplus/tests/graphicspath.c
View file @
09c96907
...
...
@@ -947,7 +947,7 @@ static path_test_t addcurve_path2[] = {
};
static
path_test_t
addcurve_path3
[]
=
{
{
10
.
0
,
10
.
0
,
PathPointTypeStart
,
0
,
0
},
/*0*/
{
13
.
3
,
16
.
7
,
PathPointTypeBezier
,
0
,
1
},
/*1*/
{
13
.
3
,
16
.
7
,
PathPointTypeBezier
,
0
,
0
},
/*1*/
{
3
.
3
,
20
.
0
,
PathPointTypeBezier
,
0
,
0
},
/*2*/
{
10
.
0
,
20
.
0
,
PathPointTypeBezier
,
0
,
0
},
/*3*/
{
16
.
7
,
20
.
0
,
PathPointTypeBezier
,
0
,
0
},
/*4*/
...
...
@@ -957,13 +957,13 @@ static path_test_t addcurve_path3[] = {
static
path_test_t
addcurve_path4
[]
=
{
{
0
.
0
,
0
.
0
,
PathPointTypeStart
,
0
,
0
},
/*0*/
{
3
.
33
,
3
.
33
,
PathPointTypeBezier
,
0
,
0
},
/*1*/
{
6
.
66
,
3
.
33
,
PathPointTypeBezier
,
0
,
1
},
/*2*/
{
6
.
66
,
3
.
33
,
PathPointTypeBezier
,
0
,
0
},
/*2*/
{
10
.
0
,
10
.
0
,
PathPointTypeBezier
,
0
,
0
},
/*3*/
};
static
path_test_t
addcurve_path5
[]
=
{
{
10
.
0
,
10
.
0
,
PathPointTypeStart
,
0
,
0
},
/*0*/
{
13
.
3
,
16
.
6
,
PathPointTypeBezier
,
0
,
1
},
/*1*/
{
3
.
33
,
20
.
0
,
PathPointTypeBezier
,
0
,
1
},
/*2*/
{
13
.
3
,
16
.
6
,
PathPointTypeBezier
,
0
,
0
},
/*1*/
{
3
.
33
,
20
.
0
,
PathPointTypeBezier
,
0
,
0
},
/*2*/
{
10
.
0
,
20
.
0
,
PathPointTypeBezier
,
0
,
0
}
/*3*/
};
...
...
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