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
b7053b74
Commit
b7053b74
authored
Jul 24, 2007
by
Evan Stade
Committed by
Alexandre Julliard
Jul 25, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdiplus: Make pen width depend on world transform.
parent
4c424b3c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
17 deletions
+34
-17
graphics.c
dlls/gdiplus/graphics.c
+34
-17
No files found.
dlls/gdiplus/graphics.c
View file @
b7053b74
...
@@ -99,10 +99,21 @@ static INT prepare_dc(GpGraphics *graphics, GpPen *pen)
...
@@ -99,10 +99,21 @@ static INT prepare_dc(GpGraphics *graphics, GpPen *pen)
HPEN
gdipen
;
HPEN
gdipen
;
REAL
width
;
REAL
width
;
INT
save_state
=
SaveDC
(
graphics
->
hdc
);
INT
save_state
=
SaveDC
(
graphics
->
hdc
);
GpPointF
pt
[
2
];
EndPath
(
graphics
->
hdc
);
EndPath
(
graphics
->
hdc
);
width
=
pen
->
width
*
convert_unit
(
graphics
->
hdc
,
/* Get an estimate for the amount the pen width is affected by the world
* transform. (This is similar to what some of the wine drivers do.) */
pt
[
0
].
X
=
0
.
0
;
pt
[
0
].
Y
=
0
.
0
;
pt
[
1
].
X
=
1
.
0
;
pt
[
1
].
Y
=
1
.
0
;
GdipTransformMatrixPoints
(
graphics
->
worldtrans
,
pt
,
2
);
width
=
sqrt
((
pt
[
1
].
X
-
pt
[
0
].
X
)
*
(
pt
[
1
].
X
-
pt
[
0
].
X
)
+
(
pt
[
1
].
Y
-
pt
[
0
].
Y
)
*
(
pt
[
1
].
Y
-
pt
[
0
].
Y
))
/
sqrt
(
2
.
0
);
width
*=
pen
->
width
*
convert_unit
(
graphics
->
hdc
,
pen
->
unit
==
UnitWorld
?
graphics
->
unit
:
pen
->
unit
);
pen
->
unit
==
UnitWorld
?
graphics
->
unit
:
pen
->
unit
);
gdipen
=
ExtCreatePen
(
pen
->
style
,
roundr
(
width
),
&
pen
->
brush
->
lb
,
0
,
NULL
);
gdipen
=
ExtCreatePen
(
pen
->
style
,
roundr
(
width
),
&
pen
->
brush
->
lb
,
0
,
NULL
);
...
@@ -205,31 +216,35 @@ static void calc_curve_bezier_endp(REAL xend, REAL yend, REAL xadj, REAL yadj,
...
@@ -205,31 +216,35 @@ static void calc_curve_bezier_endp(REAL xend, REAL yend, REAL xadj, REAL yadj,
static
void
draw_cap
(
GpGraphics
*
graphics
,
COLORREF
color
,
GpLineCap
cap
,
REAL
size
,
static
void
draw_cap
(
GpGraphics
*
graphics
,
COLORREF
color
,
GpLineCap
cap
,
REAL
size
,
const
GpCustomLineCap
*
custom
,
REAL
x1
,
REAL
y1
,
REAL
x2
,
REAL
y2
)
const
GpCustomLineCap
*
custom
,
REAL
x1
,
REAL
y1
,
REAL
x2
,
REAL
y2
)
{
{
HGDIOBJ
oldbrush
,
oldpen
;
HGDIOBJ
oldbrush
=
NULL
,
oldpen
=
NULL
;
GpMatrix
*
matrix
=
NULL
;
GpMatrix
*
matrix
=
NULL
;
HBRUSH
brush
;
HBRUSH
brush
=
NULL
;
HPEN
pen
;
HPEN
pen
=
NULL
;
PointF
ptf
[
4
],
*
custptf
=
NULL
;
PointF
ptf
[
4
],
*
custptf
=
NULL
;
POINT
pt
[
4
],
*
custpt
=
NULL
;
POINT
pt
[
4
],
*
custpt
=
NULL
;
BYTE
*
tp
=
NULL
;
BYTE
*
tp
=
NULL
;
REAL
theta
,
dsmall
,
dbig
,
dx
,
dy
=
0
.
0
;
REAL
theta
,
dsmall
,
dbig
,
dx
,
dy
=
0
.
0
;
INT
i
,
count
;
INT
i
,
count
;
LOGBRUSH
lb
;
LOGBRUSH
lb
;
BOOL
customstroke
;
if
((
x1
==
x2
)
&&
(
y1
==
y2
))
if
((
x1
==
x2
)
&&
(
y1
==
y2
))
return
;
return
;
theta
=
gdiplus_atan2
(
y2
-
y1
,
x2
-
x1
);
theta
=
gdiplus_atan2
(
y2
-
y1
,
x2
-
x1
);
brush
=
CreateSolidBrush
(
color
);
customstroke
=
(
cap
==
LineCapCustom
)
&&
custom
&&
(
!
custom
->
fill
);
lb
.
lbStyle
=
BS_SOLID
;
if
(
!
customstroke
){
lb
.
lbColor
=
color
;
brush
=
CreateSolidBrush
(
color
);
lb
.
lbHatch
=
0
;
lb
.
lbStyle
=
BS_SOLID
;
pen
=
ExtCreatePen
(
PS_GEOMETRIC
|
PS_SOLID
|
PS_ENDCAP_FLAT
,
lb
.
lbColor
=
color
;
((
cap
==
LineCapCustom
)
&&
custom
&&
(
custom
->
fill
))
?
size
:
1
,
lb
.
lbHatch
=
0
;
&
lb
,
0
,
NULL
);
pen
=
ExtCreatePen
(
PS_GEOMETRIC
|
PS_SOLID
|
PS_ENDCAP_FLAT
|
oldbrush
=
SelectObject
(
graphics
->
hdc
,
brush
);
PS_JOIN_MITER
,
1
,
&
lb
,
0
,
oldpen
=
SelectObject
(
graphics
->
hdc
,
pen
);
NULL
);
oldbrush
=
SelectObject
(
graphics
->
hdc
,
brush
);
oldpen
=
SelectObject
(
graphics
->
hdc
,
pen
);
}
switch
(
cap
){
switch
(
cap
){
case
LineCapFlat
:
case
LineCapFlat
:
...
@@ -382,10 +397,12 @@ custend:
...
@@ -382,10 +397,12 @@ custend:
break
;
break
;
}
}
SelectObject
(
graphics
->
hdc
,
oldbrush
);
if
(
!
customstroke
){
SelectObject
(
graphics
->
hdc
,
oldpen
);
SelectObject
(
graphics
->
hdc
,
oldbrush
);
DeleteObject
(
brush
);
SelectObject
(
graphics
->
hdc
,
oldpen
);
DeleteObject
(
pen
);
DeleteObject
(
brush
);
DeleteObject
(
pen
);
}
}
}
/* Shortens the line by the given percent by changing x2, y2.
/* Shortens the line by the given percent by changing x2, y2.
...
...
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