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
edee5538
Commit
edee5538
authored
Nov 25, 2022
by
Bartosz Kosiorek
Committed by
Alexandre Julliard
Nov 29, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdiplus: Add support for LineCapArrowAnchor.
Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=42809
parent
0fd51346
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
10 deletions
+29
-10
graphicspath.c
dlls/gdiplus/graphicspath.c
+26
-6
graphicspath.c
dlls/gdiplus/tests/graphicspath.c
+3
-4
No files found.
dlls/gdiplus/graphicspath.c
View file @
edee5538
...
@@ -33,6 +33,8 @@
...
@@ -33,6 +33,8 @@
WINE_DEFAULT_DEBUG_CHANNEL
(
gdiplus
);
WINE_DEFAULT_DEBUG_CHANNEL
(
gdiplus
);
#define SQRT3 1.73205080757
typedef
struct
path_list_node_t
path_list_node_t
;
typedef
struct
path_list_node_t
path_list_node_t
;
struct
path_list_node_t
{
struct
path_list_node_t
{
GpPointF
pt
;
GpPointF
pt
;
...
@@ -1890,6 +1892,7 @@ static void widen_cap(const GpPointF *endpoint, const GpPointF *nextpoint,
...
@@ -1890,6 +1892,7 @@ static void widen_cap(const GpPointF *endpoint, const GpPointF *nextpoint,
break
;
break
;
case
LineCapSquare
:
case
LineCapSquare
:
case
LineCapCustom
:
case
LineCapCustom
:
case
LineCapArrowAnchor
:
{
{
REAL
segment_dy
=
nextpoint
->
Y
-
endpoint
->
Y
;
REAL
segment_dy
=
nextpoint
->
Y
-
endpoint
->
Y
;
REAL
segment_dx
=
nextpoint
->
X
-
endpoint
->
X
;
REAL
segment_dx
=
nextpoint
->
X
-
endpoint
->
X
;
...
@@ -1909,6 +1912,11 @@ static void widen_cap(const GpPointF *endpoint, const GpPointF *nextpoint,
...
@@ -1909,6 +1912,11 @@ static void widen_cap(const GpPointF *endpoint, const GpPointF *nextpoint,
extend_dx
=
-
2
.
0
*
custom_cap
->
inset
*
extend_dx
;
extend_dx
=
-
2
.
0
*
custom_cap
->
inset
*
extend_dx
;
extend_dy
=
-
2
.
0
*
custom_cap
->
inset
*
extend_dy
;
extend_dy
=
-
2
.
0
*
custom_cap
->
inset
*
extend_dy
;
}
}
else
if
(
cap
==
LineCapArrowAnchor
)
{
extend_dx
=
-
3
.
0
*
extend_dx
;
extend_dy
=
-
3
.
0
*
extend_dy
;
}
if
(
add_first_points
)
if
(
add_first_points
)
*
last_point
=
add_path_list_node
(
*
last_point
,
endpoint
->
X
-
extend_dx
+
bevel_dx
,
*
last_point
=
add_path_list_node
(
*
last_point
,
endpoint
->
X
-
extend_dx
+
bevel_dx
,
...
@@ -2105,6 +2113,24 @@ static void add_anchor(const GpPointF *endpoint, const GpPointF *nextpoint,
...
@@ -2105,6 +2113,24 @@ static void add_anchor(const GpPointF *endpoint, const GpPointF *nextpoint,
endpoint
->
Y
+
perp_dy
,
PathPointTypeLine
);
endpoint
->
Y
+
perp_dy
,
PathPointTypeLine
);
break
;
break
;
}
}
case
LineCapArrowAnchor
:
{
REAL
segment_dy
=
nextpoint
->
Y
-
endpoint
->
Y
;
REAL
segment_dx
=
nextpoint
->
X
-
endpoint
->
X
;
REAL
segment_length
=
sqrtf
(
segment_dy
*
segment_dy
+
segment_dx
*
segment_dx
);
REAL
par_dx
=
pen_width
*
segment_dx
/
segment_length
;
REAL
par_dy
=
pen_width
*
segment_dy
/
segment_length
;
REAL
perp_dx
=
-
par_dy
;
REAL
perp_dy
=
par_dx
;
*
last_point
=
add_path_list_node
(
*
last_point
,
endpoint
->
X
,
endpoint
->
Y
,
PathPointTypeStart
);
*
last_point
=
add_path_list_node
(
*
last_point
,
endpoint
->
X
+
SQRT3
*
par_dx
-
perp_dx
,
endpoint
->
Y
+
SQRT3
*
par_dy
-
perp_dy
,
PathPointTypeLine
);
*
last_point
=
add_path_list_node
(
*
last_point
,
endpoint
->
X
+
SQRT3
*
par_dx
+
perp_dx
,
endpoint
->
Y
+
SQRT3
*
par_dy
+
perp_dy
,
PathPointTypeLine
);
break
;
}
case
LineCapCustom
:
case
LineCapCustom
:
{
{
REAL
segment_dy
=
nextpoint
->
Y
-
endpoint
->
Y
;
REAL
segment_dy
=
nextpoint
->
Y
-
endpoint
->
Y
;
...
@@ -2416,12 +2442,6 @@ GpStatus WINGDIPAPI GdipWidenPath(GpPath *path, GpPen *pen, GpMatrix *matrix,
...
@@ -2416,12 +2442,6 @@ GpStatus WINGDIPAPI GdipWidenPath(GpPath *path, GpPen *pen, GpMatrix *matrix,
last_point
=
points
;
last_point
=
points
;
if
(
pen
->
endcap
>
LineCapDiamondAnchor
&&
pen
->
endcap
!=
LineCapCustom
)
FIXME
(
"unimplemented end cap %x
\n
"
,
pen
->
endcap
);
if
(
pen
->
startcap
>
LineCapDiamondAnchor
&&
pen
->
startcap
!=
LineCapCustom
)
FIXME
(
"unimplemented start cap %x
\n
"
,
pen
->
startcap
);
if
(
pen
->
dashcap
!=
DashCapFlat
)
if
(
pen
->
dashcap
!=
DashCapFlat
)
FIXME
(
"unimplemented dash cap %d
\n
"
,
pen
->
dashcap
);
FIXME
(
"unimplemented dash cap %d
\n
"
,
pen
->
dashcap
);
...
...
dlls/gdiplus/tests/graphicspath.c
View file @
edee5538
...
@@ -114,7 +114,7 @@ static void _ok_path_fudge(GpPath* path, const path_test_t *expected, INT expect
...
@@ -114,7 +114,7 @@ static void _ok_path_fudge(GpPath* path, const path_test_t *expected, INT expect
stringify_point_type
(
types
[
idx
],
name
);
stringify_point_type
(
types
[
idx
],
name
);
todo_wine_if
(
expected
[
eidx
].
todo
||
numskip
)
todo_wine_if
(
expected
[
eidx
].
todo
||
numskip
)
ok_
(
__FILE__
,
line
)(
match
,
"Expected #%d: %s (%.
1f,%.1f) but got %s (%.1f,%.1
f)
\n
"
,
eidx
,
ok_
(
__FILE__
,
line
)(
match
,
"Expected #%d: %s (%.
6f,%.6f) but got %s (%.6f,%.6
f)
\n
"
,
eidx
,
ename
,
expected
[
eidx
].
X
,
expected
[
eidx
].
Y
,
ename
,
expected
[
eidx
].
X
,
expected
[
eidx
].
Y
,
name
,
points
[
idx
].
X
,
points
[
idx
].
Y
);
name
,
points
[
idx
].
X
,
points
[
idx
].
Y
);
...
@@ -1655,7 +1655,6 @@ static void test_widen_cap(void)
...
@@ -1655,7 +1655,6 @@ static void test_widen_cap(void)
const
path_test_t
*
expected
;
const
path_test_t
*
expected
;
INT
expected_size
;
INT
expected_size
;
BOOL
dashed
;
BOOL
dashed
;
BOOL
todo_size
;
}
}
caps
[]
=
caps
[]
=
{
{
...
@@ -1676,7 +1675,7 @@ static void test_widen_cap(void)
...
@@ -1676,7 +1675,7 @@ static void test_widen_cap(void)
{
LineCapDiamondAnchor
,
10
.
0
,
widenline_capdiamondanchor_path
,
{
LineCapDiamondAnchor
,
10
.
0
,
widenline_capdiamondanchor_path
,
ARRAY_SIZE
(
widenline_capdiamondanchor_path
)
},
ARRAY_SIZE
(
widenline_capdiamondanchor_path
)
},
{
LineCapArrowAnchor
,
10
.
0
,
widenline_caparrowanchor_path
,
{
LineCapArrowAnchor
,
10
.
0
,
widenline_caparrowanchor_path
,
ARRAY_SIZE
(
widenline_caparrowanchor_path
)
,
FALSE
,
TRUE
},
ARRAY_SIZE
(
widenline_caparrowanchor_path
)
},
{
LineCapSquareAnchor
,
0
.
0
,
widenline_capsquareanchor_thin_path
,
{
LineCapSquareAnchor
,
0
.
0
,
widenline_capsquareanchor_thin_path
,
ARRAY_SIZE
(
widenline_capsquareanchor_thin_path
)
},
ARRAY_SIZE
(
widenline_capsquareanchor_thin_path
)
},
{
LineCapSquareAnchor
,
10
.
0
,
widenline_capsquareanchor_dashed_path
,
{
LineCapSquareAnchor
,
10
.
0
,
widenline_capsquareanchor_dashed_path
,
...
@@ -1729,7 +1728,7 @@ static void test_widen_cap(void)
...
@@ -1729,7 +1728,7 @@ static void test_widen_cap(void)
}
}
}
}
ok_path_fudge
(
path
,
caps
[
i
].
expected
,
caps
[
i
].
expected_size
,
caps
[
i
].
todo_size
,
0
.
000005
);
ok_path_fudge
(
path
,
caps
[
i
].
expected
,
caps
[
i
].
expected_size
,
FALSE
,
0
.
000005
);
GdipDeletePen
(
pen
);
GdipDeletePen
(
pen
);
}
}
...
...
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