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
5fa7402a
Commit
5fa7402a
authored
Dec 22, 2014
by
Changhui Liu
Committed by
Alexandre Julliard
Jan 19, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdiplus: Fix get_graphics_bounds when window origin point changed.
parent
da8bb1c4
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
57 additions
and
2 deletions
+57
-2
graphics.c
dlls/gdiplus/graphics.c
+1
-2
graphics.c
dlls/gdiplus/tests/graphics.c
+56
-0
No files found.
dlls/gdiplus/graphics.c
View file @
5fa7402a
...
...
@@ -2029,8 +2029,7 @@ static GpStatus get_graphics_bounds(GpGraphics* graphics, GpRectF* rect)
rect
->
Height
=
GetDeviceCaps
(
graphics
->
hdc
,
VERTRES
);
}
if
(
graphics
->
hdc
&&
(
GetMapMode
(
graphics
->
hdc
)
!=
MM_TEXT
||
GetGraphicsMode
(
graphics
->
hdc
)
!=
GM_COMPATIBLE
))
if
(
graphics
->
hdc
)
{
POINT
points
[
2
];
...
...
dlls/gdiplus/tests/graphics.c
View file @
5fa7402a
...
...
@@ -5548,6 +5548,61 @@ static void test_GdipFillRectangles(void)
ReleaseDC
(
hwnd
,
hdc
);
}
static
void
test_GdipGetVisibleClipBounds_memoryDC
(
void
)
{
HDC
hdc
,
dc
;
HBITMAP
bmp
;
HGDIOBJ
old
;
RECT
rect
;
POINT
pt
;
int
width
=
0
;
int
height
=
0
;
GpGraphics
*
graphics
=
NULL
;
GpRect
boundRect
;
GpStatus
status
;
ok
(
GetClientRect
(
hwnd
,
&
rect
),
"GetClientRect should have succeeded
\n
"
);
width
=
rect
.
right
-
rect
.
left
;
height
=
rect
.
bottom
-
rect
.
top
;
dc
=
GetDC
(
hwnd
);
hdc
=
CreateCompatibleDC
(
dc
);
bmp
=
CreateCompatibleBitmap
(
dc
,
width
,
height
);
old
=
SelectObject
(
hdc
,
bmp
);
/*change the window origin is the key test point*/
SetWindowOrgEx
(
hdc
,
rect
.
left
+
10
,
rect
.
top
+
10
,
&
pt
);
status
=
GdipCreateFromHDC
(
hdc
,
&
graphics
);
expect
(
Ok
,
status
);
status
=
GdipGetVisibleClipBoundsI
(
graphics
,
&
boundRect
);
expect
(
Ok
,
status
);
ok
(
boundRect
.
X
==
rect
.
left
+
10
&&
boundRect
.
Y
==
rect
.
top
+
10
&&
boundRect
.
Width
==
width
&&
boundRect
.
Height
==
height
,
"Expected GdipGetVisibleClipBoundsI ok
\n
"
);
status
=
GdipSetClipRectI
(
graphics
,
0
,
0
,
width
,
height
,
CombineModeReplace
);
expect
(
Ok
,
status
);
status
=
GdipGetVisibleClipBoundsI
(
graphics
,
&
boundRect
);
expect
(
Ok
,
status
);
ok
(
boundRect
.
X
==
rect
.
left
+
10
&&
boundRect
.
Y
==
rect
.
top
+
10
&&
boundRect
.
Width
==
width
-
10
&&
boundRect
.
Height
==
height
-
10
,
"Expected GdipGetVisibleClipBoundsI ok
\n
"
);
GdipDeleteGraphics
(
graphics
);
SelectObject
(
hdc
,
old
);
DeleteObject
(
bmp
);
DeleteDC
(
hdc
);
ReleaseDC
(
hwnd
,
dc
);
}
START_TEST
(
graphics
)
{
struct
GdiplusStartupInput
gdiplusStartupInput
;
...
...
@@ -5619,6 +5674,7 @@ START_TEST(graphics)
test_alpha_hdc
();
test_bitmapfromgraphics
();
test_GdipFillRectangles
();
test_GdipGetVisibleClipBounds_memoryDC
();
GdiplusShutdown
(
gdiplusToken
);
DestroyWindow
(
hwnd
);
...
...
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