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
0937186f
Commit
0937186f
authored
Nov 14, 2018
by
Nikolay Sivov
Committed by
Alexandre Julliard
Nov 28, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdiplus: Fix brush transform created with GdipCreateLineBrushFromRect().
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
6906117b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
32 deletions
+6
-32
brush.c
dlls/gdiplus/brush.c
+6
-28
brush.c
dlls/gdiplus/tests/brush.c
+0
-4
No files found.
dlls/gdiplus/brush.c
View file @
0937186f
...
...
@@ -408,9 +408,7 @@ GpStatus WINGDIPAPI GdipCreateLineBrushFromRect(GDIPCONST GpRectF* rect,
ARGB
startcolor
,
ARGB
endcolor
,
LinearGradientMode
mode
,
GpWrapMode
wrap
,
GpLineGradient
**
line
)
{
GpPointF
start
,
end
;
GpStatus
stat
;
float
far_x
,
far_y
;
float
angle
;
TRACE
(
"(%p, %x, %x, %d, %d, %p)
\n
"
,
rect
,
startcolor
,
endcolor
,
mode
,
wrap
,
line
);
...
...
@@ -418,45 +416,25 @@ GpStatus WINGDIPAPI GdipCreateLineBrushFromRect(GDIPCONST GpRectF* rect,
if
(
!
line
||
!
rect
)
return
InvalidParameter
;
far_x
=
rect
->
X
+
rect
->
Width
;
far_y
=
rect
->
Y
+
rect
->
Height
;
switch
(
mode
)
{
case
LinearGradientModeHorizontal
:
start
.
X
=
min
(
rect
->
X
,
far_x
);
start
.
Y
=
rect
->
Y
;
end
.
X
=
max
(
rect
->
X
,
far_x
);
end
.
Y
=
rect
->
Y
;
angle
=
0
.
0
f
;
break
;
case
LinearGradientModeVertical
:
start
.
X
=
rect
->
X
;
start
.
Y
=
min
(
rect
->
Y
,
far_y
);
end
.
X
=
rect
->
X
;
end
.
Y
=
max
(
rect
->
Y
,
far_y
);
angle
=
90
.
0
f
;
break
;
case
LinearGradientModeForwardDiagonal
:
start
.
X
=
min
(
rect
->
X
,
far_x
);
start
.
Y
=
min
(
rect
->
Y
,
far_y
);
end
.
X
=
max
(
rect
->
X
,
far_x
);
end
.
Y
=
max
(
rect
->
Y
,
far_y
);
angle
=
45
.
0
f
;
break
;
case
LinearGradientModeBackwardDiagonal
:
start
.
X
=
max
(
rect
->
X
,
far_x
);
start
.
Y
=
min
(
rect
->
Y
,
far_y
);
end
.
X
=
min
(
rect
->
X
,
far_x
);
end
.
Y
=
max
(
rect
->
Y
,
far_y
);
angle
=
135
.
0
f
;
break
;
default:
return
InvalidParameter
;
}
stat
=
GdipCreateLineBrush
(
&
start
,
&
end
,
startcolor
,
endcolor
,
wrap
,
line
);
if
(
stat
==
Ok
)
(
*
line
)
->
rect
=
*
rect
;
return
stat
;
return
GdipCreateLineBrushFromRectWithAngle
(
rect
,
startcolor
,
endcolor
,
angle
,
TRUE
,
wrap
,
line
);
}
GpStatus
WINGDIPAPI
GdipCreateLineBrushFromRectI
(
GDIPCONST
GpRect
*
rect
,
...
...
dlls/gdiplus/tests/brush.c
View file @
0937186f
...
...
@@ -764,15 +764,11 @@ static void test_gradientgetrect(void)
#define expectf2(expected, got) ok(fabs(expected - got) < 0.001, "%u: expected %.3f, got %.3f.\n", i, expected, got)
expectf2
(
create_from_rect
[
i
].
transform
[
0
],
elements
[
0
]);
todo_wine_if
(
create_from_rect
[
i
].
mode
==
LinearGradientModeVertical
)
{
expectf2
(
create_from_rect
[
i
].
transform
[
1
],
elements
[
1
]);
expectf2
(
create_from_rect
[
i
].
transform
[
2
],
elements
[
2
]);
}
expectf2
(
create_from_rect
[
i
].
transform
[
3
],
elements
[
3
]);
todo_wine_if
(
create_from_rect
[
i
].
mode
==
LinearGradientModeVertical
)
{
expectf2
(
create_from_rect
[
i
].
transform
[
4
],
elements
[
4
]);
expectf2
(
create_from_rect
[
i
].
transform
[
5
],
elements
[
5
]);
}
#undef expectf2
}
...
...
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