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
1dbe178f
Commit
1dbe178f
authored
Jun 19, 2007
by
Misha Koshelev
Committed by
Alexandre Julliard
Jun 19, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdi32: Fix ArcTo to use proper starting and ending points.
parent
2c9c761b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
36 additions
and
20 deletions
+36
-20
painting.c
dlls/gdi32/painting.c
+34
-18
path.c
dlls/gdi32/tests/path.c
+2
-2
No files found.
dlls/gdi32/painting.c
View file @
1dbe178f
...
...
@@ -118,28 +118,44 @@ BOOL WINAPI ArcTo( HDC hdc,
if
(
!
dc
)
return
FALSE
;
if
(
dc
->
funcs
->
pArcTo
)
{
result
=
dc
->
funcs
->
pArcTo
(
dc
->
physDev
,
left
,
top
,
right
,
bottom
,
xstart
,
ystart
,
xend
,
yend
);
GDI_ReleaseObj
(
hdc
);
return
result
;
else
{
double
width
=
fabs
(
right
-
left
),
height
=
fabs
(
bottom
-
top
),
xradius
=
width
/
2
,
yradius
=
height
/
2
,
xcenter
=
right
>
left
?
left
+
xradius
:
right
+
xradius
,
ycenter
=
bottom
>
top
?
top
+
yradius
:
bottom
+
yradius
;
/*
* Else emulate it.
* According to the documentation, a line is drawn from the current
* position to the starting point of the arc.
*/
double
angle
=
atan2
(
((
ystart
-
ycenter
)
/
height
),
((
xstart
-
xcenter
)
/
width
));
LineTo
(
hdc
,
GDI_ROUND
(
xcenter
+
(
cos
(
angle
)
*
xradius
)),
GDI_ROUND
(
ycenter
+
(
sin
(
angle
)
*
yradius
)));
/*
* Then the arc is drawn.
*/
result
=
Arc
(
hdc
,
left
,
top
,
right
,
bottom
,
xstart
,
ystart
,
xend
,
yend
);
/*
* If no error occurred, the current position is moved to the ending
* point of the arc.
*/
if
(
result
)
{
angle
=
atan2
(
((
yend
-
ycenter
)
/
height
),
((
xend
-
xcenter
)
/
width
));
MoveToEx
(
hdc
,
GDI_ROUND
(
xcenter
+
(
cos
(
angle
)
*
xradius
)),
GDI_ROUND
(
ycenter
+
(
sin
(
angle
)
*
yradius
)),
NULL
);
}
}
GDI_ReleaseObj
(
hdc
);
/*
* Else emulate it.
* According to the documentation, a line is drawn from the current
* position to the starting point of the arc.
*/
LineTo
(
hdc
,
xstart
,
ystart
);
/*
* Then the arc is drawn.
*/
result
=
Arc
(
hdc
,
left
,
top
,
right
,
bottom
,
xstart
,
ystart
,
xend
,
yend
);
/*
* If no error occurred, the current position is moved to the ending
* point of the arc.
*/
if
(
result
)
MoveToEx
(
hdc
,
xend
,
yend
,
NULL
);
return
result
;
}
...
...
dlls/gdi32/tests/path.c
View file @
1dbe178f
...
...
@@ -193,7 +193,7 @@ static void ok_path(HDC hdc, const path_test_t *expected, int expected_size, BOO
static
const
path_test_t
arcto_path
[]
=
{
{
0
,
0
,
PT_MOVETO
,
0
,
0
},
/* 0 */
{
229
,
215
,
PT_LINETO
,
0
,
1
},
/* 1 */
{
229
,
215
,
PT_LINETO
,
0
,
0
},
/* 1 */
{
248
,
205
,
PT_BEZIERTO
,
1
,
0
},
/* 2 */
{
273
,
200
,
PT_BEZIERTO
,
0
,
0
},
/* 3 */
{
300
,
200
,
PT_BEZIERTO
,
0
,
0
},
/* 4 */
...
...
@@ -203,7 +203,7 @@ static const path_test_t arcto_path[] = {
{
399
,
263
,
PT_BEZIERTO
,
0
,
0
},
/* 8 */
{
389
,
275
,
PT_BEZIERTO
,
0
,
0
},
/* 9 */
{
370
,
285
,
PT_BEZIERTO
,
0
,
0
},
/* 10 */
{
363
,
277
,
PT_LINETO
,
1
,
1
},
/* 11 */
{
363
,
277
,
PT_LINETO
,
1
,
0
},
/* 11 */
{
380
,
270
,
PT_BEZIERTO
,
1
,
0
},
/* 12 */
{
389
,
260
,
PT_BEZIERTO
,
0
,
0
},
/* 13 */
{
389
,
250
,
PT_BEZIERTO
,
0
,
0
},
/* 14 */
...
...
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