Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
L
libvncserver
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
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
rasky
libvncserver
Commits
dd923e86
Commit
dd923e86
authored
Jan 18, 2005
by
dscho
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add convenience function to clip using x2,y2 instead of w,h
parent
9cc78e54
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
0 deletions
+25
-0
rfbregion.c
libvncserver/rfbregion.c
+22
-0
rfbregion.h
rfb/rfbregion.h
+3
-0
No files found.
libvncserver/rfbregion.c
View file @
dd923e86
...
@@ -803,6 +803,28 @@ sraClipRect(int *x, int *y, int *w, int *h,
...
@@ -803,6 +803,28 @@ sraClipRect(int *x, int *y, int *w, int *h,
return
(
*
w
>
0
)
&&
(
*
h
>
0
);
return
(
*
w
>
0
)
&&
(
*
h
>
0
);
}
}
rfbBool
sraClipRect2
(
int
*
x
,
int
*
y
,
int
*
x2
,
int
*
y2
,
int
cx
,
int
cy
,
int
cx2
,
int
cy2
)
{
if
(
*
x
<
cx
)
*
x
=
cx
;
if
(
*
y
<
cy
)
*
y
=
cy
;
if
(
*
x
>=
cx2
)
*
x
=
cx2
-
1
;
if
(
*
y
>=
cy2
)
*
y
=
cy2
-
1
;
if
(
*
x2
<=
cx
)
*
x2
=
cx
+
1
;
if
(
*
y2
<=
cy
)
*
y2
=
cy
+
1
;
if
(
*
x2
>
cx2
)
*
x2
=
cx2
;
if
(
*
y2
>
cy2
)
*
y2
=
cy2
;
return
(
*
x2
>*
x
)
&&
(
*
y2
>*
y
);
}
/* test */
/* test */
#ifdef SRA_TEST
#ifdef SRA_TEST
...
...
rfb/rfbregion.h
View file @
dd923e86
...
@@ -59,4 +59,7 @@ void sraRgnPrint(const sraRegion *s);
...
@@ -59,4 +59,7 @@ void sraRgnPrint(const sraRegion *s);
extern
rfbBool
sraClipRect
(
int
*
x
,
int
*
y
,
int
*
w
,
int
*
h
,
extern
rfbBool
sraClipRect
(
int
*
x
,
int
*
y
,
int
*
w
,
int
*
h
,
int
cx
,
int
cy
,
int
cw
,
int
ch
);
int
cx
,
int
cy
,
int
cw
,
int
ch
);
extern
rfbBool
sraClipRect2
(
int
*
x
,
int
*
y
,
int
*
x2
,
int
*
y2
,
int
cx
,
int
cy
,
int
cx2
,
int
cy2
);
#endif
#endif
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