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
71e4af50
Commit
71e4af50
authored
Feb 06, 2010
by
Vincent Povirk
Committed by
Alexandre Julliard
Feb 08, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdiplus: Use linear gradient brush angles.
parent
318ba286
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
60 additions
and
6 deletions
+60
-6
brush.c
dlls/gdiplus/brush.c
+60
-6
No files found.
dlls/gdiplus/brush.c
View file @
71e4af50
...
...
@@ -468,20 +468,74 @@ GpStatus WINGDIPAPI GdipCreateLineBrushFromRectI(GDIPCONST GpRect* rect,
/******************************************************************************
* GdipCreateLineBrushFromRectWithAngle [GDIPLUS.@]
*
* FIXME: angle value completely ignored. Don't know how to use it since native
* always set Brush rectangle to rect (independetly of this angle).
* Maybe it's used only on drawing.
*/
GpStatus
WINGDIPAPI
GdipCreateLineBrushFromRectWithAngle
(
GDIPCONST
GpRectF
*
rect
,
ARGB
startcolor
,
ARGB
endcolor
,
REAL
angle
,
BOOL
isAngleScalable
,
GpWrapMode
wrap
,
GpLineGradient
**
line
)
{
GpStatus
stat
;
LinearGradientMode
mode
;
REAL
width
,
height
,
exofs
,
eyofs
;
REAL
sin_angle
,
cos_angle
,
sin_cos_angle
;
TRACE
(
"(%p, %x, %x, %.2f, %d, %d, %p)
\n
"
,
rect
,
startcolor
,
endcolor
,
angle
,
isAngleScalable
,
wrap
,
line
);
return
GdipCreateLineBrushFromRect
(
rect
,
startcolor
,
endcolor
,
LinearGradientModeForwardDiagonal
,
wrap
,
line
);
sin_angle
=
sinf
(
deg2rad
(
angle
));
cos_angle
=
cosf
(
deg2rad
(
angle
));
sin_cos_angle
=
sin_angle
*
cos_angle
;
if
(
isAngleScalable
)
{
width
=
height
=
1
.
0
;
}
else
{
width
=
rect
->
Width
;
height
=
rect
->
Height
;
}
if
(
sin_cos_angle
>=
0
)
mode
=
LinearGradientModeForwardDiagonal
;
else
mode
=
LinearGradientModeBackwardDiagonal
;
stat
=
GdipCreateLineBrushFromRect
(
rect
,
startcolor
,
endcolor
,
mode
,
wrap
,
line
);
if
(
stat
==
Ok
)
{
if
(
sin_cos_angle
>=
0
)
{
exofs
=
width
*
sin_cos_angle
+
height
*
cos_angle
*
cos_angle
;
eyofs
=
width
*
sin_angle
*
sin_angle
+
height
*
sin_cos_angle
;
}
else
{
exofs
=
width
*
sin_angle
*
sin_angle
+
height
*
sin_cos_angle
;
eyofs
=
-
width
*
sin_cos_angle
+
height
*
sin_angle
*
sin_angle
;
}
if
(
isAngleScalable
)
{
exofs
=
exofs
*
rect
->
Width
;
eyofs
=
eyofs
*
rect
->
Height
;
}
if
(
sin_angle
>=
0
)
{
(
*
line
)
->
endpoint
.
X
=
rect
->
X
+
exofs
;
(
*
line
)
->
endpoint
.
Y
=
rect
->
Y
+
eyofs
;
}
else
{
(
*
line
)
->
endpoint
.
X
=
(
*
line
)
->
startpoint
.
X
;
(
*
line
)
->
endpoint
.
Y
=
(
*
line
)
->
startpoint
.
Y
;
(
*
line
)
->
startpoint
.
X
=
rect
->
X
+
exofs
;
(
*
line
)
->
startpoint
.
Y
=
rect
->
Y
+
eyofs
;
}
}
return
stat
;
}
GpStatus
WINGDIPAPI
GdipCreateLineBrushFromRectWithAngleI
(
GDIPCONST
GpRect
*
rect
,
...
...
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