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
abdde73a
Commit
abdde73a
authored
Mar 05, 2020
by
Jeff Smith
Committed by
Alexandre Julliard
Jul 10, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdiplus: Dash pattern scaling does not shrink below line width 1.0.
Signed-off-by:
Jeff Smith
<
whydoubt@gmail.com
>
parent
7026effe
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
1 deletion
+25
-1
graphicspath.c
dlls/gdiplus/graphicspath.c
+2
-1
graphicspath.c
dlls/gdiplus/tests/graphicspath.c
+23
-0
No files found.
dlls/gdiplus/graphicspath.c
View file @
abdde73a
...
...
@@ -2295,6 +2295,7 @@ static void widen_dashed_figure(GpPath *path, int start, int end, int closed,
int
dash_index
=
0
;
const
REAL
*
dash_pattern
;
REAL
*
dash_pattern_scaled
;
REAL
dash_pattern_scaling
=
max
(
pen
->
width
,
1
.
0
);
int
dash_count
;
GpPointF
*
tmp_points
;
REAL
segment_dy
;
...
...
@@ -2337,7 +2338,7 @@ static void widen_dashed_figure(GpPath *path, int start, int end, int closed,
if
(
!
dash_pattern_scaled
)
return
;
for
(
i
=
0
;
i
<
dash_count
;
i
++
)
dash_pattern_scaled
[
i
]
=
pen
->
width
*
dash_pattern
[
i
];
dash_pattern_scaled
[
i
]
=
dash_pattern_scaling
*
dash_pattern
[
i
];
tmp_points
=
heap_alloc_zero
((
end
-
start
+
2
)
*
sizeof
(
GpPoint
));
if
(
!
tmp_points
)
{
...
...
dlls/gdiplus/tests/graphicspath.c
View file @
abdde73a
...
...
@@ -1278,6 +1278,17 @@ static path_test_t widenline_dash_path[] = {
{
45
.
0
,
10
.
0
,
PathPointTypeLine
|
PathPointTypeCloseSubpath
,
0
,
0
},
/*7*/
};
static
path_test_t
widenline_thin_dash_path
[]
=
{
{
5
.
0
,
4
.
75
,
PathPointTypeStart
,
0
,
0
},
/*0*/
{
8
.
0
,
4
.
75
,
PathPointTypeLine
,
0
,
0
},
/*1*/
{
8
.
0
,
5
.
25
,
PathPointTypeLine
,
0
,
0
},
/*2*/
{
5
.
0
,
5
.
25
,
PathPointTypeLine
|
PathPointTypeCloseSubpath
,
0
,
0
},
/*3*/
{
9
.
0
,
4
.
75
,
PathPointTypeStart
,
0
,
0
},
/*4*/
{
9
.
5
,
4
.
75
,
PathPointTypeLine
,
0
,
0
},
/*5*/
{
9
.
5
,
5
.
25
,
PathPointTypeLine
,
0
,
0
},
/*6*/
{
9
.
0
,
5
.
25
,
PathPointTypeLine
|
PathPointTypeCloseSubpath
,
0
,
0
},
/*7*/
};
static
path_test_t
widenline_unit_path
[]
=
{
{
5
.
0
,
9
.
5
,
PathPointTypeStart
,
0
,
0
},
/*0*/
{
50
.
0
,
9
.
5
,
PathPointTypeLine
,
0
,
0
},
/*1*/
...
...
@@ -1375,6 +1386,18 @@ static void test_widen(void)
status
=
GdipSetPenDashStyle
(
pen
,
DashStyleSolid
);
expect
(
Ok
,
status
);
/* dashed line less than 1 pixel wide */
GdipDeletePen
(
pen
);
GdipCreatePen1
(
0xffffffff
,
0
.
5
,
UnitPixel
,
&
pen
);
GdipSetPenDashStyle
(
pen
,
DashStyleDash
);
GdipResetPath
(
path
);
GdipAddPathLine
(
path
,
5
.
0
,
5
.
0
,
9
.
5
,
5
.
0
);
status
=
GdipWidenPath
(
path
,
pen
,
m
,
1
.
0
);
expect
(
Ok
,
status
);
ok_path_fudge
(
path
,
widenline_thin_dash_path
,
ARRAY_SIZE
(
widenline_thin_dash_path
),
FALSE
,
0
.
000005
);
/* pen width in UnitWorld */
GdipDeletePen
(
pen
);
status
=
GdipCreatePen1
(
0xffffffff
,
10
.
0
,
UnitWorld
,
&
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