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
ba4ef584
Commit
ba4ef584
authored
Dec 05, 2012
by
Vincent Povirk
Committed by
Alexandre Julliard
Dec 06, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdiplus: Fix graphics bounds for memory DC's.
parent
81d9ffa0
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
0 deletions
+27
-0
graphics.c
dlls/gdiplus/graphics.c
+19
-0
graphics.c
dlls/gdiplus/tests/graphics.c
+8
-0
No files found.
dlls/gdiplus/graphics.c
View file @
ba4ef584
...
...
@@ -2113,6 +2113,25 @@ static GpStatus get_graphics_bounds(GpGraphics* graphics, GpRectF* rect)
stat
=
GdipGetImageBounds
(
graphics
->
image
,
rect
,
&
unit
);
if
(
stat
==
Ok
&&
unit
!=
UnitPixel
)
FIXME
(
"need to convert from unit %i
\n
"
,
unit
);
}
else
if
(
GetObjectType
(
graphics
->
hdc
)
==
OBJ_MEMDC
){
HBITMAP
hbmp
;
BITMAP
bmp
;
rect
->
X
=
0
;
rect
->
Y
=
0
;
hbmp
=
GetCurrentObject
(
graphics
->
hdc
,
OBJ_BITMAP
);
if
(
hbmp
&&
GetObjectW
(
hbmp
,
sizeof
(
bmp
),
&
bmp
))
{
rect
->
Width
=
bmp
.
bmWidth
;
rect
->
Height
=
bmp
.
bmHeight
;
}
else
{
/* FIXME: ??? */
rect
->
Width
=
1
;
rect
->
Height
=
1
;
}
}
else
{
rect
->
X
=
0
;
rect
->
Y
=
0
;
...
...
dlls/gdiplus/tests/graphics.c
View file @
ba4ef584
...
...
@@ -4091,6 +4091,7 @@ static void test_alpha_hdc(void)
GpGraphics
*
graphics
;
ULONG
*
bits
;
BITMAPINFO
bmi
;
GpRectF
bounds
;
hdc
=
CreateCompatibleDC
(
0
);
ok
(
hdc
!=
NULL
,
"CreateCompatibleDC failed
\n
"
);
...
...
@@ -4110,6 +4111,13 @@ static void test_alpha_hdc(void)
status
=
GdipCreateFromHDC
(
hdc
,
&
graphics
);
expect
(
Ok
,
status
);
status
=
GdipGetVisibleClipBounds
(
graphics
,
&
bounds
);
expect
(
Ok
,
status
);
expectf
(
0
.
0
,
bounds
.
X
);
expectf
(
0
.
0
,
bounds
.
Y
);
expectf
(
5
.
0
,
bounds
.
Width
);
expectf
(
5
.
0
,
bounds
.
Height
);
bits
[
0
]
=
0xdeadbeef
;
status
=
GdipGraphicsClear
(
graphics
,
0xffaaaaaa
);
...
...
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