Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
859bf44c
Commit
859bf44c
authored
Jun 20, 2007
by
Misha Koshelev
Committed by
Alexandre Julliard
Jun 21, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdi32: Handle ArcTo in paths as native.
parent
e04aebd6
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
8 deletions
+24
-8
painting.c
dlls/gdi32/painting.c
+3
-1
path.c
dlls/gdi32/path.c
+18
-4
path.c
dlls/gdi32/tests/path.c
+3
-3
No files found.
dlls/gdi32/painting.c
View file @
859bf44c
...
...
@@ -124,7 +124,9 @@ BOOL WINAPI ArcTo( HDC hdc,
DC
*
dc
=
DC_GetDCUpdate
(
hdc
);
if
(
!
dc
)
return
FALSE
;
if
(
dc
->
funcs
->
pArcTo
)
if
(
PATH_IsPathOpen
(
dc
->
path
))
result
=
PATH_Arc
(
dc
,
left
,
top
,
right
,
bottom
,
xstart
,
ystart
,
xend
,
yend
,
-
1
);
else
if
(
dc
->
funcs
->
pArcTo
)
result
=
dc
->
funcs
->
pArcTo
(
dc
->
physDev
,
left
,
top
,
right
,
bottom
,
xstart
,
ystart
,
xend
,
yend
);
else
/* We'll draw a line from the current position to the starting point of the arc, then draw the arc */
...
...
dlls/gdi32/path.c
View file @
859bf44c
...
...
@@ -725,8 +725,10 @@ BOOL PATH_Ellipse(DC *dc, INT x1, INT y1, INT x2, INT y2)
* Should be called when a call to Arc is performed on a DC that has
* an open path. This adds up to five Bezier splines representing the arc
* to the path. When 'lines' is 1, we add 1 extra line to get a chord,
* and when 'lines' is 2, we add 2 extra lines to get a pie.
* Returns TRUE if successful, else FALSE.
* when 'lines' is 2, we add 2 extra lines to get a pie, and when 'lines' is
* -1 we add 1 extra line from the current DC position to the starting position
* of the arc before drawing the arc itself (arcto). Returns TRUE if successful,
* else FALSE.
*/
BOOL
PATH_Arc
(
DC
*
dc
,
INT
x1
,
INT
y1
,
INT
x2
,
INT
y2
,
INT
xStart
,
INT
yStart
,
INT
xEnd
,
INT
yEnd
,
INT
lines
)
...
...
@@ -736,7 +738,7 @@ BOOL PATH_Arc(DC *dc, INT x1, INT y1, INT x2, INT y2,
/* Initialize angleEndQuadrant to silence gcc's warning */
double
x
,
y
;
FLOAT_POINT
corners
[
2
],
pointStart
,
pointEnd
;
POINT
centre
;
POINT
centre
,
pointCurPos
;
BOOL
start
,
end
;
INT
temp
;
...
...
@@ -811,6 +813,18 @@ BOOL PATH_Arc(DC *dc, INT x1, INT y1, INT x2, INT y2,
corners
[
1
].
y
--
;
}
/* arcto: Add a PT_MOVETO only if this is the first entry in a stroke */
if
(
lines
==-
1
&&
pPath
->
newStroke
)
{
pPath
->
newStroke
=
FALSE
;
pointCurPos
.
x
=
dc
->
CursPosX
;
pointCurPos
.
y
=
dc
->
CursPosY
;
if
(
!
LPtoDP
(
dc
->
hSelf
,
&
pointCurPos
,
1
))
return
FALSE
;
if
(
!
PATH_AddEntry
(
pPath
,
&
pointCurPos
,
PT_MOVETO
))
return
FALSE
;
}
/* Add the arc to the path with one Bezier spline per quadrant that the
* arc spans */
start
=
TRUE
;
...
...
@@ -848,7 +862,7 @@ BOOL PATH_Arc(DC *dc, INT x1, INT y1, INT x2, INT y2,
/* Add the Bezier spline to the path */
PATH_DoArcPart
(
pPath
,
corners
,
angleStartQuadrant
,
angleEndQuadrant
,
start
?
PT_MOVETO
:
FALSE
);
start
?
(
lines
==-
1
?
PT_LINETO
:
PT_MOVETO
)
:
FALSE
);
start
=
FALSE
;
}
while
(
!
end
);
...
...
dlls/gdi32/tests/path.c
View file @
859bf44c
...
...
@@ -194,7 +194,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
,
0
},
/* 1 */
{
248
,
205
,
PT_BEZIERTO
,
1
,
0
},
/* 2 */
{
248
,
205
,
PT_BEZIERTO
,
0
,
0
},
/* 2 */
{
273
,
200
,
PT_BEZIERTO
,
0
,
0
},
/* 3 */
{
300
,
200
,
PT_BEZIERTO
,
0
,
0
},
/* 4 */
{
355
,
200
,
PT_BEZIERTO
,
0
,
0
},
/* 5 */
...
...
@@ -204,7 +204,7 @@ static const path_test_t arcto_path[] = {
{
389
,
275
,
PT_BEZIERTO
,
0
,
0
},
/* 9 */
{
370
,
285
,
PT_BEZIERTO
,
0
,
0
},
/* 10 */
{
363
,
277
,
PT_LINETO
,
0
,
0
},
/* 11 */
{
380
,
270
,
PT_BEZIERTO
,
1
,
0
},
/* 12 */
{
380
,
270
,
PT_BEZIERTO
,
0
,
0
},
/* 12 */
{
389
,
260
,
PT_BEZIERTO
,
0
,
0
},
/* 13 */
{
389
,
250
,
PT_BEZIERTO
,
0
,
0
},
/* 14 */
{
389
,
228
,
PT_BEZIERTO
,
0
,
0
},
/* 15 */
...
...
@@ -232,7 +232,7 @@ static void test_arcto(void)
CloseFigure
(
hdc
);
EndPath
(
hdc
);
ok_path
(
hdc
,
arcto_path
,
sizeof
(
arcto_path
)
/
sizeof
(
path_test_t
),
1
);
ok_path
(
hdc
,
arcto_path
,
sizeof
(
arcto_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