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
920b050a
Commit
920b050a
authored
Jun 21, 2007
by
Misha Koshelev
Committed by
Alexandre Julliard
Jun 22, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdi32: Emulate AngleArc using ArcTo.
parent
ce8e6d16
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
37 deletions
+28
-37
painting.c
dlls/gdi32/painting.c
+16
-25
path.c
dlls/gdi32/tests/path.c
+12
-12
No files found.
dlls/gdi32/painting.c
View file @
920b050a
...
...
@@ -793,34 +793,25 @@ BOOL WINAPI AngleArc(HDC hdc, INT x, INT y, DWORD dwRadius, FLOAT eStartAngle, F
dc
=
DC_GetDCUpdate
(
hdc
);
if
(
!
dc
)
return
FALSE
;
if
(
dc
->
funcs
->
pAngleArc
)
{
result
=
dc
->
funcs
->
pAngleArc
(
dc
->
physDev
,
x
,
y
,
dwRadius
,
eStartAngle
,
eSweepAngle
);
GDI_ReleaseObj
(
hdc
);
return
result
;
}
GDI_ReleaseObj
(
hdc
);
/* AngleArc always works counterclockwise */
arcdir
=
GetArcDirection
(
hdc
);
SetArcDirection
(
hdc
,
AD_COUNTERCLOCKWISE
);
x1
=
x
+
cos
(
eStartAngle
*
M_PI
/
180
)
*
dwRadius
;
y1
=
y
-
sin
(
eStartAngle
*
M_PI
/
180
)
*
dwRadius
;
/* Calculate the end point */
x2
=
x
+
cos
((
eStartAngle
+
eSweepAngle
)
*
M_PI
/
180
)
*
dwRadius
;
y2
=
y
-
sin
((
eStartAngle
+
eSweepAngle
)
*
M_PI
/
180
)
*
dwRadius
;
LineTo
(
hdc
,
x1
,
y1
);
if
(
eSweepAngle
>=
0
)
result
=
Arc
(
hdc
,
x
-
dwRadius
,
y
-
dwRadius
,
x
+
dwRadius
,
y
+
dwRadius
,
x1
,
y1
,
x2
,
y2
);
else
result
=
Arc
(
hdc
,
x
-
dwRadius
,
y
-
dwRadius
,
x
+
dwRadius
,
y
+
dwRadius
,
x2
,
y2
,
x1
,
y1
);
if
(
result
)
MoveToEx
(
hdc
,
x2
,
y2
,
NULL
);
SetArcDirection
(
hdc
,
arcdir
);
if
(
!
PATH_IsPathOpen
(
dc
->
path
)
&&
dc
->
funcs
->
pAngleArc
)
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
;
arcdir
=
SetArcDirection
(
hdc
,
eSweepAngle
>=
0
?
AD_COUNTERCLOCKWISE
:
AD_CLOCKWISE
);
result
=
ArcTo
(
hdc
,
x
-
dwRadius
,
y
-
dwRadius
,
x
+
dwRadius
,
y
+
dwRadius
,
x1
,
y1
,
x2
,
y2
);
SetArcDirection
(
hdc
,
arcdir
);
}
if
(
result
)
{
dc
->
CursPosX
=
x2
;
dc
->
CursPosY
=
y2
;
}
return
result
;
}
...
...
dlls/gdi32/tests/path.c
View file @
920b050a
...
...
@@ -252,7 +252,7 @@ done:
static
const
path_test_t
anglearc_path
[]
=
{
{
0
,
0
,
PT_MOVETO
,
0
,
0
},
/* 0 */
{
371
,
229
,
PT_LINETO
,
0
,
0
},
/* 1 */
{
352
,
211
,
PT_BEZIERTO
,
1
,
0
},
/* 2 */
{
352
,
211
,
PT_BEZIERTO
,
0
,
0
},
/* 2 */
{
327
,
200
,
PT_BEZIERTO
,
0
,
0
},
/* 3 */
{
300
,
200
,
PT_BEZIERTO
,
0
,
0
},
/* 4 */
{
245
,
200
,
PT_BEZIERTO
,
0
,
0
},
/* 5 */
...
...
@@ -261,16 +261,16 @@ static const path_test_t anglearc_path[] = {
{
200
,
300
,
PT_BEZIERTO
,
0
,
2
},
/* 8 */
{
200
,
300
,
PT_BEZIERTO
,
0
,
2
},
/* 9 */
{
200
,
300
,
PT_BEZIERTO
,
0
,
2
},
/* 10 */
{
231
,
260
,
PT_LINETO
,
1
,
0
},
/* 11 */
{
245
,
235
,
PT_BEZIERTO
,
1
,
1
},
/* 12 */
{
271
,
220
,
PT_BEZIERTO
,
0
,
1
},
/* 13 */
{
300
,
220
,
PT_BEZIERTO
,
0
,
1
},
/* 14 */
{
344
,
220
,
PT_BEZIERTO
,
0
,
1
},
/* 15 */
{
380
,
256
,
PT_BEZIERTO
,
0
,
1
},
/* 16 */
{
380
,
300
,
PT_BEZIERTO
,
0
,
1
},
/* 17 */
{
380
,
314
,
PT_BEZIERTO
,
0
,
1
},
/* 18 */
{
376
,
328
,
PT_BEZIERTO
,
0
,
1
},
/* 19 */
{
369
,
340
,
PT_BEZIERTO
|
PT_CLOSEFIGURE
,
0
,
1
}};
/* 20 */
{
231
,
260
,
PT_LINETO
,
0
,
0
},
/* 11 */
{
245
,
235
,
PT_BEZIERTO
,
0
,
0
},
/* 12 */
{
271
,
220
,
PT_BEZIERTO
,
0
,
0
},
/* 13 */
{
300
,
220
,
PT_BEZIERTO
,
0
,
0
},
/* 14 */
{
344
,
220
,
PT_BEZIERTO
,
0
,
0
},
/* 15 */
{
380
,
256
,
PT_BEZIERTO
,
0
,
0
},
/* 16 */
{
380
,
300
,
PT_BEZIERTO
,
0
,
0
},
/* 17 */
{
380
,
314
,
PT_BEZIERTO
,
0
,
0
},
/* 18 */
{
376
,
328
,
PT_BEZIERTO
,
0
,
0
},
/* 19 */
{
369
,
340
,
PT_BEZIERTO
|
PT_CLOSEFIGURE
,
0
,
0
}};
/* 20 */
static
void
test_anglearc
(
void
)
{
...
...
@@ -287,7 +287,7 @@ static void test_anglearc(void)
CloseFigure
(
hdc
);
EndPath
(
hdc
);
ok_path
(
hdc
,
"anglearc_path"
,
anglearc_path
,
sizeof
(
anglearc_path
)
/
sizeof
(
path_test_t
),
0
);
ok_path
(
hdc
,
"anglearc_path"
,
anglearc_path
,
sizeof
(
anglearc_path
)
/
sizeof
(
path_test_t
),
1
);
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