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
Alexey Alyaev
wine
Commits
edc90a9f
Commit
edc90a9f
authored
20 years ago
by
Alexandre Julliard
Browse files
Options
Downloads
Patches
Plain Diff
Added rect_in_region function.
parent
80bba3bd
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
server/region.c
+17
-0
17 additions, 0 deletions
server/region.c
server/user.h
+1
-0
1 addition, 0 deletions
server/user.h
with
18 additions
and
0 deletions
server/region.c
+
17
−
0
View file @
edc90a9f
...
...
@@ -775,3 +775,20 @@ int point_in_region( struct region *region, int x, int y )
}
return
0
;
}
/* check if the given rectangle is (at least partially) inside the region */
int
rect_in_region
(
struct
region
*
region
,
const
rectangle_t
*
rect
)
{
const
rectangle_t
*
ptr
,
*
end
;
for
(
ptr
=
region
->
rects
,
end
=
region
->
rects
+
region
->
num_rects
;
ptr
<
end
;
ptr
++
)
{
if
(
ptr
->
top
>
rect
->
bottom
)
return
0
;
if
(
ptr
->
bottom
<=
rect
->
top
)
continue
;
/* now we are in the correct band */
if
(
ptr
->
left
>
rect
->
right
)
return
0
;
if
(
ptr
->
right
<=
rect
->
left
)
continue
;
return
1
;
}
return
0
;
}
This diff is collapsed.
Click to expand it.
server/user.h
+
1
−
0
View file @
edc90a9f
...
...
@@ -84,6 +84,7 @@ extern struct region *subtract_region( struct region *dst, const struct region *
extern
struct
region
*
union_region
(
struct
region
*
dst
,
const
struct
region
*
src1
,
const
struct
region
*
src2
);
extern
int
point_in_region
(
struct
region
*
region
,
int
x
,
int
y
);
extern
int
rect_in_region
(
struct
region
*
region
,
const
rectangle_t
*
rect
);
static
inline
struct
region
*
create_empty_region
(
void
)
{
return
create_region
(
NULL
,
0
);
}
/* window functions */
...
...
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