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
92d5b415
Commit
92d5b415
authored
Jan 06, 2012
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdi32: Add a helper function for computing the device rect for PS_INSIDEFRAME.
parent
5ff28562
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
20 deletions
+19
-20
graphics.c
dlls/gdi32/dibdrv/graphics.c
+19
-20
No files found.
dlls/gdi32/dibdrv/graphics.c
View file @
92d5b415
...
...
@@ -57,6 +57,21 @@ static RECT get_device_rect( HDC hdc, int left, int top, int right, int bottom,
return
rect
;
}
static
BOOL
get_pen_device_rect
(
dibdrv_physdev
*
dev
,
RECT
*
rect
,
int
left
,
int
top
,
int
right
,
int
bottom
)
{
*
rect
=
get_device_rect
(
dev
->
dev
.
hdc
,
left
,
top
,
right
,
bottom
,
TRUE
);
if
(
rect
->
left
==
rect
->
right
||
rect
->
top
==
rect
->
bottom
)
return
FALSE
;
if
(
dev
->
pen_style
==
PS_INSIDEFRAME
)
{
rect
->
left
+=
dev
->
pen_width
/
2
;
rect
->
top
+=
dev
->
pen_width
/
2
;
rect
->
right
-=
(
dev
->
pen_width
-
1
)
/
2
;
rect
->
bottom
-=
(
dev
->
pen_width
-
1
)
/
2
;
}
return
TRUE
;
}
/* compute the points for the first quadrant of an ellipse, counterclockwise from the x axis */
/* 'data' must contain enough space, (width+height)/2 is a reasonable upper bound */
static
int
ellipse_first_quadrant
(
int
width
,
int
height
,
POINT
*
data
)
...
...
@@ -696,22 +711,14 @@ BOOL dibdrv_Polyline( PHYSDEV dev, const POINT* pt, INT count )
BOOL
dibdrv_Rectangle
(
PHYSDEV
dev
,
INT
left
,
INT
top
,
INT
right
,
INT
bottom
)
{
dibdrv_physdev
*
pdev
=
get_dibdrv_pdev
(
dev
);
RECT
rect
=
get_device_rect
(
dev
->
hdc
,
left
,
top
,
right
,
bottom
,
TRUE
)
;
RECT
rect
;
POINT
pts
[
4
];
BOOL
ret
;
HRGN
outline
=
0
;
TRACE
(
"(%p, %d, %d, %d, %d)
\n
"
,
dev
,
left
,
top
,
right
,
bottom
);
if
(
rect
.
left
==
rect
.
right
||
rect
.
top
==
rect
.
bottom
)
return
TRUE
;
if
(
pdev
->
pen_style
==
PS_INSIDEFRAME
)
{
rect
.
left
+=
pdev
->
pen_width
/
2
;
rect
.
top
+=
pdev
->
pen_width
/
2
;
rect
.
right
-=
(
pdev
->
pen_width
-
1
)
/
2
;
rect
.
bottom
-=
(
pdev
->
pen_width
-
1
)
/
2
;
}
if
(
!
get_pen_device_rect
(
pdev
,
&
rect
,
left
,
top
,
right
,
bottom
))
return
TRUE
;
if
(
pdev
->
pen_uses_region
&&
!
(
outline
=
CreateRectRgn
(
0
,
0
,
0
,
0
)))
return
FALSE
;
...
...
@@ -769,21 +776,13 @@ BOOL dibdrv_RoundRect( PHYSDEV dev, INT left, INT top, INT right, INT bottom,
INT
ellipse_width
,
INT
ellipse_height
)
{
dibdrv_physdev
*
pdev
=
get_dibdrv_pdev
(
dev
);
RECT
rect
=
get_device_rect
(
dev
->
hdc
,
left
,
top
,
right
,
bottom
,
TRUE
)
;
RECT
rect
;
POINT
pt
[
2
],
*
points
;
int
i
,
end
,
count
;
BOOL
ret
=
TRUE
;
HRGN
outline
=
0
,
interior
=
0
;
if
(
rect
.
left
==
rect
.
right
||
rect
.
top
==
rect
.
bottom
)
return
TRUE
;
if
(
pdev
->
pen_style
==
PS_INSIDEFRAME
)
{
rect
.
left
+=
pdev
->
pen_width
/
2
;
rect
.
top
+=
pdev
->
pen_width
/
2
;
rect
.
right
-=
(
pdev
->
pen_width
-
1
)
/
2
;
rect
.
bottom
-=
(
pdev
->
pen_width
-
1
)
/
2
;
}
if
(
!
get_pen_device_rect
(
pdev
,
&
rect
,
left
,
top
,
right
,
bottom
))
return
TRUE
;
pt
[
0
].
x
=
pt
[
0
].
y
=
0
;
pt
[
1
].
x
=
ellipse_width
;
...
...
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