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
bd5ccea5
Commit
bd5ccea5
authored
Apr 09, 2010
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdi32: Avoid some rounding errors in AngleArc.
parent
76a97127
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
8 deletions
+8
-8
painting.c
dlls/gdi32/painting.c
+4
-4
path.c
dlls/gdi32/tests/path.c
+4
-4
No files found.
dlls/gdi32/painting.c
View file @
bd5ccea5
...
...
@@ -854,8 +854,8 @@ BOOL WINAPI AngleArc(HDC hdc, INT x, INT y, DWORD dwRadius, FLOAT eStartAngle, F
if
(
!
dc
)
return
FALSE
;
/* Calculate the end point */
x2
=
x
+
cos
((
eStartAngle
+
eSweepAngle
)
*
M_PI
/
180
)
*
dwRadius
;
y2
=
y
-
sin
((
eStartAngle
+
eSweepAngle
)
*
M_PI
/
180
)
*
dwRadius
;
x2
=
GDI_ROUND
(
x
+
cos
((
eStartAngle
+
eSweepAngle
)
*
M_PI
/
180
)
*
dwRadius
)
;
y2
=
GDI_ROUND
(
y
-
sin
((
eStartAngle
+
eSweepAngle
)
*
M_PI
/
180
)
*
dwRadius
)
;
if
(
!
PATH_IsPathOpen
(
dc
->
path
)
&&
dc
->
funcs
->
pAngleArc
)
{
...
...
@@ -863,8 +863,8 @@ BOOL WINAPI AngleArc(HDC hdc, INT x, INT y, DWORD dwRadius, FLOAT eStartAngle, F
result
=
dc
->
funcs
->
pAngleArc
(
dc
->
physDev
,
x
,
y
,
dwRadius
,
eStartAngle
,
eSweepAngle
);
}
else
{
/* do it using ArcTo */
x1
=
x
+
cos
(
eStartAngle
*
M_PI
/
180
)
*
dwRadius
;
y1
=
y
-
sin
(
eStartAngle
*
M_PI
/
180
)
*
dwRadius
;
x1
=
GDI_ROUND
(
x
+
cos
(
eStartAngle
*
M_PI
/
180
)
*
dwRadius
)
;
y1
=
GDI_ROUND
(
y
-
sin
(
eStartAngle
*
M_PI
/
180
)
*
dwRadius
)
;
arcdir
=
SetArcDirection
(
hdc
,
eSweepAngle
>=
0
?
AD_COUNTERCLOCKWISE
:
AD_CLOCKWISE
);
result
=
ArcTo
(
hdc
,
x
-
dwRadius
,
y
-
dwRadius
,
x
+
dwRadius
,
y
+
dwRadius
,
...
...
dlls/gdi32/tests/path.c
View file @
bd5ccea5
...
...
@@ -260,9 +260,9 @@ static const path_test_t anglearc_path[] = {
{
245
,
200
,
PT_BEZIERTO
,
0
,
0
},
/* 5 */
{
200
,
245
,
PT_BEZIERTO
,
0
,
0
},
/* 6 */
{
200
,
300
,
PT_BEZIERTO
,
0
,
0
},
/* 7 */
{
200
,
300
,
PT_BEZIERTO
,
0
,
2
},
/* 8 */
{
200
,
300
,
PT_BEZIERTO
,
0
,
2
},
/* 9 */
{
200
,
300
,
PT_BEZIERTO
,
0
,
2
},
/* 10 */
{
200
,
300
,
PT_BEZIERTO
,
0
,
0
},
/* 8 */
{
200
,
300
,
PT_BEZIERTO
,
0
,
0
},
/* 9 */
{
200
,
300
,
PT_BEZIERTO
,
0
,
0
},
/* 10 */
{
231
,
260
,
PT_LINETO
,
0
,
0
},
/* 11 */
{
245
,
235
,
PT_BEZIERTO
,
0
,
0
},
/* 12 */
{
271
,
220
,
PT_BEZIERTO
,
0
,
0
},
/* 13 */
...
...
@@ -289,7 +289,7 @@ static void test_anglearc(void)
CloseFigure
(
hdc
);
EndPath
(
hdc
);
ok_path
(
hdc
,
"anglearc_path"
,
anglearc_path
,
sizeof
(
anglearc_path
)
/
sizeof
(
path_test_t
),
1
);
ok_path
(
hdc
,
"anglearc_path"
,
anglearc_path
,
sizeof
(
anglearc_path
)
/
sizeof
(
path_test_t
),
0
);
done:
ReleaseDC
(
0
,
hdc
);
}
...
...
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