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
1f61f482
Commit
1f61f482
authored
Jul 27, 2007
by
Evan Stade
Committed by
Alexandre Julliard
Jul 30, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdiplus: Draw custom dashes.
parent
4e4c150b
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
8 deletions
+21
-8
gdiplus_private.h
dlls/gdiplus/gdiplus_private.h
+1
-0
graphics.c
dlls/gdiplus/graphics.c
+18
-2
pen.c
dlls/gdiplus/pen.c
+2
-6
No files found.
dlls/gdiplus/gdiplus_private.h
View file @
1f61f482
...
...
@@ -26,6 +26,7 @@
#define GP_DEFAULT_PENSTYLE (PS_GEOMETRIC | PS_SOLID | PS_ENDCAP_FLAT | PS_JOIN_MITER)
#define MAX_ARC_PTS (13)
#define MAX_DASHLEN (16)
/* this is a limitation of gdi */
COLORREF
ARGB2COLORREF
(
ARGB
color
);
extern
INT
arc2polybezier
(
GpPointF
*
points
,
REAL
x1
,
REAL
y1
,
REAL
x2
,
REAL
y2
,
...
...
dlls/gdiplus/graphics.c
View file @
1f61f482
...
...
@@ -98,8 +98,9 @@ static INT prepare_dc(GpGraphics *graphics, GpPen *pen)
{
HPEN
gdipen
;
REAL
width
;
INT
save_state
=
SaveDC
(
graphics
->
hdc
);
INT
save_state
=
SaveDC
(
graphics
->
hdc
)
,
i
,
numdashes
;
GpPointF
pt
[
2
];
DWORD
dash_array
[
MAX_DASHLEN
];
EndPath
(
graphics
->
hdc
);
...
...
@@ -116,7 +117,22 @@ static INT prepare_dc(GpGraphics *graphics, GpPen *pen)
width
*=
pen
->
width
*
convert_unit
(
graphics
->
hdc
,
pen
->
unit
==
UnitWorld
?
graphics
->
unit
:
pen
->
unit
);
gdipen
=
ExtCreatePen
(
pen
->
style
,
roundr
(
width
),
&
pen
->
brush
->
lb
,
0
,
NULL
);
if
(
pen
->
dash
==
DashStyleCustom
){
numdashes
=
min
(
pen
->
numdashes
,
MAX_DASHLEN
);
TRACE
(
"dashes are: "
);
for
(
i
=
0
;
i
<
numdashes
;
i
++
){
dash_array
[
i
]
=
roundr
(
width
*
pen
->
dashes
[
i
]);
TRACE
(
"%d, "
,
dash_array
[
i
]);
}
TRACE
(
"
\n
and the pen style is %x
\n
"
,
pen
->
style
);
gdipen
=
ExtCreatePen
(
pen
->
style
,
roundr
(
width
),
&
pen
->
brush
->
lb
,
numdashes
,
dash_array
);
}
else
gdipen
=
ExtCreatePen
(
pen
->
style
,
roundr
(
width
),
&
pen
->
brush
->
lb
,
0
,
NULL
);
SelectObject
(
graphics
->
hdc
,
gdipen
);
return
save_state
;
...
...
dlls/gdiplus/pen.c
View file @
1f61f482
...
...
@@ -29,8 +29,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(gdiplus);
static
DWORD
gdip_to_gdi_dash
(
GpDashStyle
dash
)
{
static
int
calls
;
switch
(
dash
){
case
DashStyleSolid
:
return
PS_SOLID
;
...
...
@@ -43,9 +41,7 @@ static DWORD gdip_to_gdi_dash(GpDashStyle dash)
case
DashStyleDashDotDot
:
return
PS_DASHDOTDOT
;
case
DashStyleCustom
:
if
(
!
(
calls
++
))
FIXME
(
"DashStyleCustom not implemented
\n
"
);
return
PS_SOLID
;
return
PS_USERSTYLE
;
default:
ERR
(
"Not a member of GpDashStyle enumeration
\n
"
);
return
0
;
...
...
@@ -240,7 +236,7 @@ GpStatus WINGDIPAPI GdipSetPenDashArray(GpPen *pen, GDIPCONST REAL *dash,
return
OutOfMemory
;
}
pen
->
dash
=
DashStyleCustom
;
GdipSetPenDashStyle
(
pen
,
DashStyleCustom
)
;
memcpy
(
pen
->
dashes
,
dash
,
count
*
sizeof
(
REAL
));
pen
->
numdashes
=
count
;
...
...
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