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
c3e8af41
Commit
c3e8af41
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: Use world transform when drawing points.
parent
f30732fd
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
20 deletions
+20
-20
graphics.c
dlls/gdiplus/graphics.c
+20
-20
No files found.
dlls/gdiplus/graphics.c
View file @
c3e8af41
...
...
@@ -83,9 +83,10 @@ static BYTE convert_path_point_type(BYTE type)
* gdi to draw, and these functions would irreparably mess with line widths.
*/
static
void
transform_and_round_points
(
GpGraphics
*
graphics
,
POINT
*
pti
,
G
DIPCONST
G
pPointF
*
ptf
,
INT
count
)
GpPointF
*
ptf
,
INT
count
)
{
REAL
unitscale
;
GpMatrix
*
matrix
;
int
i
;
switch
(
graphics
->
unit
)
...
...
@@ -113,9 +114,13 @@ static void transform_and_round_points(GpGraphics *graphics, POINT *pti,
if
(
graphics
->
unit
!=
UnitDisplay
)
unitscale
*=
graphics
->
scale
;
GdipCloneMatrix
(
graphics
->
worldtrans
,
&
matrix
);
GdipScaleMatrix
(
matrix
,
unitscale
,
unitscale
,
MatrixOrderAppend
);
GdipTransformMatrixPoints
(
matrix
,
ptf
,
count
);
for
(
i
=
0
;
i
<
count
;
i
++
){
pti
[
i
].
x
=
roundr
(
unitscale
*
ptf
[
i
].
X
);
pti
[
i
].
y
=
roundr
(
unitscale
*
ptf
[
i
].
Y
);
pti
[
i
].
x
=
roundr
(
ptf
[
i
].
X
);
pti
[
i
].
y
=
roundr
(
ptf
[
i
].
Y
);
}
}
...
...
@@ -431,9 +436,9 @@ static GpStatus draw_polyline(GpGraphics *graphics, GpPen *pen,
goto
end
;
}
if
(
caps
){
memcpy
(
ptcopy
,
pt
,
count
*
sizeof
(
GpPointF
));
memcpy
(
ptcopy
,
pt
,
count
*
sizeof
(
GpPointF
));
if
(
caps
){
if
(
pen
->
endcap
==
LineCapArrowAnchor
)
shorten_line_amt
(
ptcopy
[
count
-
2
].
X
,
ptcopy
[
count
-
2
].
Y
,
&
ptcopy
[
count
-
1
].
X
,
&
ptcopy
[
count
-
1
].
Y
,
pen
->
width
);
...
...
@@ -454,11 +459,9 @@ static GpStatus draw_polyline(GpGraphics *graphics, GpPen *pen,
pt
[
count
-
2
].
X
,
pt
[
count
-
2
].
Y
,
pt
[
count
-
1
].
X
,
pt
[
count
-
1
].
Y
);
draw_cap
(
graphics
,
pen
->
brush
->
lb
.
lbColor
,
pen
->
startcap
,
pen
->
width
,
pen
->
customstart
,
pt
[
1
].
X
,
pt
[
1
].
Y
,
pt
[
0
].
X
,
pt
[
0
].
Y
);
\
transform_and_round_points
(
graphics
,
pti
,
ptcopy
,
count
);
}
else
transform_and_round_points
(
graphics
,
pti
,
pt
,
count
);
transform_and_round_points
(
graphics
,
pti
,
ptcopy
,
count
);
Polyline
(
graphics
->
hdc
,
pti
,
count
);
...
...
@@ -533,9 +536,9 @@ static GpStatus draw_polybezier(GpGraphics *graphics, GpPen *pen,
goto
end
;
}
if
(
caps
){
memcpy
(
ptcopy
,
pt
,
count
*
sizeof
(
GpPointF
));
memcpy
(
ptcopy
,
pt
,
count
*
sizeof
(
GpPointF
));
if
(
caps
){
if
(
pen
->
endcap
==
LineCapArrowAnchor
)
shorten_bezier_amt
(
&
ptcopy
[
count
-
4
],
pen
->
width
,
FALSE
);
/* FIXME The following is seemingly correct only for baseinset < 0 or
...
...
@@ -574,11 +577,9 @@ static GpStatus draw_polybezier(GpGraphics *graphics, GpPen *pen,
draw_cap
(
graphics
,
pen
->
brush
->
lb
.
lbColor
,
pen
->
startcap
,
pen
->
width
,
pen
->
customstart
,
pt
[
0
].
X
-
(
ptcopy
[
0
].
X
-
ptcopy
[
1
].
X
),
pt
[
0
].
Y
-
(
ptcopy
[
0
].
Y
-
ptcopy
[
1
].
Y
),
pt
[
0
].
X
,
pt
[
0
].
Y
);
transform_and_round_points
(
graphics
,
pti
,
ptcopy
,
count
);
}
else
transform_and_round_points
(
graphics
,
pti
,
pt
,
count
);
transform_and_round_points
(
graphics
,
pti
,
ptcopy
,
count
);
PolyBezier
(
graphics
->
hdc
,
pti
,
count
);
...
...
@@ -622,11 +623,11 @@ static GpStatus draw_poly(GpGraphics *graphics, GpPen *pen, GDIPCONST GpPointF *
}
}
memcpy
(
ptcopy
,
pt
,
count
*
sizeof
(
GpPointF
));
/* If we are drawing caps, go through the points and adjust them accordingly,
* and draw the caps. */
if
(
caps
){
memcpy
(
ptcopy
,
pt
,
count
*
sizeof
(
GpPointF
));
switch
(
types
[
count
-
1
]
&
PathPointTypePathTypeMask
){
case
PathPointTypeBezier
:
if
(
pen
->
endcap
==
LineCapArrowAnchor
)
...
...
@@ -711,10 +712,9 @@ static GpStatus draw_poly(GpGraphics *graphics, GpPen *pen, GDIPCONST GpPointF *
ERR
(
"Bad path points
\n
"
);
goto
end
;
}
transform_and_round_points
(
graphics
,
pti
,
ptcopy
,
count
);
}
else
transform_and_round_points
(
graphics
,
pti
,
pt
,
count
);
transform_and_round_points
(
graphics
,
pti
,
ptcopy
,
count
);
for
(
i
=
0
;
i
<
count
;
i
++
){
tp
[
i
]
=
convert_path_point_type
(
types
[
i
]);
...
...
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