Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
wine
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Package registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Yoann Laissus
wine
Commits
e0a25722
Commit
e0a25722
authored
26 years ago
by
Huw D. M. Davies
Committed by
Alexandre Julliard
26 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Fixed differences between SetRectRgn16 and SetRectRgn32. Also a bug fix for
CreateRoundRectRgn.
parent
66cd3334
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
objects/region.c
+43
-9
43 additions, 9 deletions
objects/region.c
with
43 additions
and
9 deletions
objects/region.c
+
43
−
9
View file @
e0a25722
...
...
@@ -254,10 +254,18 @@ INT32 WINAPI GetRgnBox32( HRGN32 hrgn, LPRECT32 rect )
/***********************************************************************
* CreateRectRgn16 (GDI.64)
*
* NOTE: Doesn't call CreateRectRgn32 because of differences in SetRectRgn16/32
*/
HRGN16
WINAPI
CreateRectRgn16
(
INT16
left
,
INT16
top
,
INT16
right
,
INT16
bottom
)
{
return
(
HRGN16
)
CreateRectRgn32
(
left
,
top
,
right
,
bottom
);
HRGN16
hrgn
;
if
(
!
(
hrgn
=
(
HRGN16
)
REGION_CreateRegion
()))
return
0
;
TRACE
(
region
,
"
\n
"
);
SetRectRgn16
(
hrgn
,
left
,
top
,
right
,
bottom
);
return
hrgn
;
}
...
...
@@ -270,7 +278,7 @@ HRGN32 WINAPI CreateRectRgn32(INT32 left, INT32 top, INT32 right, INT32 bottom)
if
(
!
(
hrgn
=
REGION_CreateRegion
()))
return
0
;
TRACE
(
region
,
"
\n
"
);
TRACE
(
region
,
"
\n
"
);
SetRectRgn32
(
hrgn
,
left
,
top
,
right
,
bottom
);
return
hrgn
;
}
...
...
@@ -280,7 +288,7 @@ HRGN32 WINAPI CreateRectRgn32(INT32 left, INT32 top, INT32 right, INT32 bottom)
*/
HRGN16
WINAPI
CreateRectRgnIndirect16
(
const
RECT16
*
rect
)
{
return
CreateRectRgn
32
(
rect
->
left
,
rect
->
top
,
rect
->
right
,
rect
->
bottom
);
return
CreateRectRgn
16
(
rect
->
left
,
rect
->
top
,
rect
->
right
,
rect
->
bottom
);
}
...
...
@@ -295,16 +303,23 @@ HRGN32 WINAPI CreateRectRgnIndirect32( const RECT32* rect )
/***********************************************************************
* SetRectRgn16 (GDI.172)
*
* NOTE: Win 3.1 sets region to empty if left > right
*/
VOID
WINAPI
SetRectRgn16
(
HRGN16
hrgn
,
INT16
left
,
INT16
top
,
INT16
right
,
INT16
bottom
)
{
SetRectRgn32
(
hrgn
,
left
,
top
,
right
,
bottom
);
if
(
left
<
right
)
SetRectRgn32
(
hrgn
,
left
,
top
,
right
,
bottom
);
else
SetRectRgn32
(
hrgn
,
0
,
0
,
0
,
0
);
}
/***********************************************************************
* SetRectRgn32 (GDI32.332)
*
* Allows either or both left and top to be greater than right or bottom.
*/
VOID
WINAPI
SetRectRgn32
(
HRGN32
hrgn
,
INT32
left
,
INT32
top
,
INT32
right
,
INT32
bottom
)
...
...
@@ -315,7 +330,11 @@ VOID WINAPI SetRectRgn32( HRGN32 hrgn, INT32 left, INT32 top,
hrgn
,
left
,
top
,
right
,
bottom
);
if
(
!
(
obj
=
(
RGNOBJ
*
)
GDI_GetObjPtr
(
hrgn
,
REGION_MAGIC
)))
return
;
if
((
right
>
left
)
&&
(
bottom
>
top
))
if
(
left
>
right
)
{
INT32
tmp
=
left
;
left
=
right
;
right
=
tmp
;
}
if
(
top
>
bottom
)
{
INT32
tmp
=
top
;
top
=
bottom
;
bottom
=
tmp
;
}
if
((
left
!=
right
)
&&
(
top
!=
bottom
))
{
obj
->
rgn
->
rects
->
left
=
obj
->
rgn
->
extents
.
left
=
left
;
obj
->
rgn
->
rects
->
top
=
obj
->
rgn
->
extents
.
top
=
top
;
...
...
@@ -333,12 +352,20 @@ VOID WINAPI SetRectRgn32( HRGN32 hrgn, INT32 left, INT32 top,
/***********************************************************************
* CreateRoundRectRgn16 (GDI.444)
*
* If either ellipse dimension is zero we call CreateRectRgn16 for its
* `special' behaviour. -ve ellipse dimensions can result in GPFs under win3.1
* we just let CreateRoundRectRgn32 convert them to +ve values.
*/
HRGN16
WINAPI
CreateRoundRectRgn16
(
INT16
left
,
INT16
top
,
INT16
right
,
INT16
bottom
,
INT16
ellipse_width
,
INT16
ellipse_height
)
{
return
(
HRGN16
)
CreateRoundRectRgn32
(
left
,
top
,
right
,
bottom
,
if
(
ellipse_width
==
0
||
ellipse_height
==
0
)
return
CreateRectRgn16
(
left
,
top
,
right
,
bottom
);
else
return
(
HRGN16
)
CreateRoundRectRgn32
(
left
,
top
,
right
,
bottom
,
ellipse_width
,
ellipse_height
);
}
...
...
@@ -356,10 +383,17 @@ HRGN32 WINAPI CreateRoundRectRgn32( INT32 left, INT32 top,
/* Check if we can do a normal rectangle instead */
if
((
right
<=
left
)
||
(
bottom
<=
top
)
||
(
ellipse_width
<=
0
)
||
(
ellipse_height
<=
0
))
if
((
ellipse_width
==
0
)
||
(
ellipse_height
==
0
))
return
CreateRectRgn32
(
left
,
top
,
right
,
bottom
);
/* Make the dimensions sensible */
if
(
left
>
right
)
{
INT32
tmp
=
left
;
left
=
right
;
right
=
tmp
;
}
if
(
top
>
bottom
)
{
INT32
tmp
=
top
;
top
=
bottom
;
bottom
=
tmp
;
}
ellipse_width
=
abs
(
ellipse_width
);
ellipse_height
=
abs
(
ellipse_height
);
/* Create region */
if
(
!
(
hrgn
=
REGION_CreateRegion
()))
return
0
;
...
...
@@ -382,7 +416,7 @@ HRGN32 WINAPI CreateRoundRectRgn32( INT32 left, INT32 top,
yd
=
asq
*
ellipse_height
;
/* 2a^2b */
rect
.
left
=
left
+
ellipse_width
/
2
;
rect
.
right
=
right
-
ellipse_width
;
rect
.
right
=
right
-
ellipse_width
/
2
;
/* Loop to draw first half of quadrant */
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment