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
818051de
Commit
818051de
authored
Jul 20, 2007
by
Evan Stade
Committed by
Alexandre Julliard
Jul 23, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdiplus: Change atan2 to gdiplus_arctan2.
parent
a84b567c
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
8 deletions
+15
-8
gdiplus.c
dlls/gdiplus/gdiplus.c
+10
-1
gdiplus_private.h
dlls/gdiplus/gdiplus_private.h
+1
-0
graphics.c
dlls/gdiplus/graphics.c
+4
-7
No files found.
dlls/gdiplus/gdiplus.c
View file @
818051de
...
...
@@ -154,7 +154,7 @@ static void unstretch_angle(REAL * angle, REAL rad_x, REAL rad_y)
if
(
cos
(
*
angle
)
==
0
||
sin
(
*
angle
)
==
0
)
return
;
stretched
=
atan2
(
sin
(
*
angle
)
/
rad_y
,
cos
(
*
angle
)
/
rad_x
);
stretched
=
gdiplus_
atan2
(
sin
(
*
angle
)
/
rad_y
,
cos
(
*
angle
)
/
rad_x
);
revs_off
=
roundr
(
*
angle
/
(
2
.
0
*
M_PI
))
-
roundr
(
stretched
/
(
2
.
0
*
M_PI
));
stretched
+=
((
REAL
)
revs_off
)
*
M_PI
*
2
.
0
;
*
angle
=
stretched
;
...
...
@@ -212,3 +212,12 @@ COLORREF ARGB2COLORREF(ARGB color)
(
color
&
0x00ff00
)
+
((
color
&
0xff0000
)
>>
16
);
}
/* Like atan2, but puts angle in correct quadrant if dx is 0. */
FLOAT
gdiplus_atan2
(
FLOAT
dy
,
FLOAT
dx
)
{
if
((
dx
==
0
.
0
)
&&
(
dy
!=
0
.
0
))
return
dy
>
0
.
0
?
M_PI_2
:
-
M_PI_2
;
return
atan2
(
dy
,
dx
);
}
dlls/gdiplus/gdiplus_private.h
View file @
818051de
...
...
@@ -30,6 +30,7 @@
COLORREF
ARGB2COLORREF
(
ARGB
color
);
extern
INT
arc2polybezier
(
GpPointF
*
points
,
REAL
x1
,
REAL
y1
,
REAL
x2
,
REAL
y2
,
REAL
startAngle
,
REAL
sweepAngle
);
extern
FLOAT
gdiplus_atan2
(
FLOAT
dy
,
FLOAT
dx
);
static
inline
INT
roundr
(
REAL
x
)
{
...
...
dlls/gdiplus/graphics.c
View file @
818051de
...
...
@@ -146,14 +146,11 @@ static void draw_cap(HDC hdc, COLORREF color, GpLineCap cap, REAL size,
INT
i
,
count
;
LOGBRUSH
lb
;
if
(
x2
!=
x1
)
theta
=
atan2
(
y2
-
y1
,
x2
-
x1
);
else
if
(
y2
!=
y1
){
theta
=
M_PI_2
*
(
y2
>
y1
?
1
.
0
:
-
1
.
0
);
}
else
if
((
x1
==
x2
)
&&
(
y1
==
y2
))
return
;
theta
=
gdiplus_atan2
(
y2
-
y1
,
x2
-
x1
);
brush
=
CreateSolidBrush
(
color
);
lb
.
lbStyle
=
BS_SOLID
;
lb
.
lbColor
=
color
;
...
...
@@ -327,7 +324,7 @@ static void shorten_line_percent(REAL x1, REAL y1, REAL *x2, REAL *y2, REAL per
return
;
dist
=
sqrt
((
*
x2
-
x1
)
*
(
*
x2
-
x1
)
+
(
*
y2
-
y1
)
*
(
*
y2
-
y1
))
*
-
percent
;
theta
=
(
*
x2
==
x1
?
M_PI_2
:
atan2
((
*
y2
-
y1
),
(
*
x2
-
x1
)
));
theta
=
gdiplus_atan2
((
*
y2
-
y1
),
(
*
x2
-
x1
));
dx
=
cos
(
theta
)
*
dist
;
dy
=
sin
(
theta
)
*
dist
;
...
...
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