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
6fb77fb0
Commit
6fb77fb0
authored
May 24, 2005
by
dscho
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix off by one bug
parent
1b830d04
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
4 deletions
+8
-4
example.c
examples/example.c
+4
-2
font.c
libvncserver/font.c
+4
-2
No files found.
examples/example.c
View file @
6fb77fb0
...
...
@@ -107,7 +107,6 @@ static void drawline(unsigned char* buffer,int rowstride,int bpp,int x1,int y1,i
if
(
j
<
0
)
j
=-
j
;
if
(
i
<
j
)
{
if
(
y1
>
y2
)
{
i
=
y2
;
y2
=
y1
;
y1
=
i
;
i
=
x2
;
x2
=
x1
;
x1
=
i
;
}
if
(
y2
==
y1
)
{
if
(
y2
>
0
)
y1
--
;
else
y2
++
;
}
for
(
j
=
y1
;
j
<=
y2
;
j
++
)
for
(
i
=
0
;
i
<
bpp
;
i
++
)
buffer
[
j
*
rowstride
+
(
x1
+
(
j
-
y1
)
*
(
x2
-
x1
)
/
(
y2
-
y1
))
*
bpp
+
i
]
=
0xff
;
...
...
@@ -132,6 +131,9 @@ static void doptr(int buttonMask,int x,int y,rfbClientPtr cl)
if
(
cd
->
oldButton
==
buttonMask
)
{
/* draw a line */
drawline
((
unsigned
char
*
)
cl
->
screen
->
frameBuffer
,
cl
->
screen
->
paddedWidthInBytes
,
bpp
,
x
,
y
,
cd
->
oldx
,
cd
->
oldy
);
x1
=
x
;
y1
=
y
;
if
(
x1
>
cd
->
oldx
)
x1
++
;
else
cd
->
oldx
++
;
if
(
y1
>
cd
->
oldy
)
y1
++
;
else
cd
->
oldy
++
;
rfbMarkRectAsModified
(
cl
->
screen
,
x
,
y
,
cd
->
oldx
,
cd
->
oldy
);
}
else
{
/* draw a point (diameter depends on button) */
int
w
=
cl
->
screen
->
paddedWidthInBytes
;
...
...
@@ -143,7 +145,7 @@ static void doptr(int buttonMask,int x,int y,rfbClientPtr cl)
for
(
i
=
x1
*
bpp
;
i
<
x2
*
bpp
;
i
++
)
for
(
j
=
y1
;
j
<
y2
;
j
++
)
cl
->
screen
->
frameBuffer
[
j
*
w
+
i
]
=
(
char
)
0xff
;
rfbMarkRectAsModified
(
cl
->
screen
,
x1
,
y1
,
x2
-
1
,
y2
-
1
);
rfbMarkRectAsModified
(
cl
->
screen
,
x1
,
y1
,
x2
,
y2
);
}
/* we could get a selection like that:
...
...
libvncserver/font.c
View file @
6fb77fb0
...
...
@@ -131,8 +131,8 @@ void rfbFontBBox(rfbFontDataPtr font,unsigned char c,int* x1,int* y1,int* x2,int
{
*
x1
+=
font
->
metaData
[
c
*
5
+
3
];
*
y1
+=-
font
->
metaData
[
c
*
5
+
4
]
-
font
->
metaData
[
c
*
5
+
2
]
+
1
;
*
x2
=*
x1
+
font
->
metaData
[
c
*
5
+
1
];
*
y2
=*
y1
+
font
->
metaData
[
c
*
5
+
2
];
*
x2
=*
x1
+
font
->
metaData
[
c
*
5
+
1
]
+
1
;
*
y2
=*
y1
+
font
->
metaData
[
c
*
5
+
2
]
+
1
;
}
#ifndef INT_MAX
...
...
@@ -156,6 +156,8 @@ void rfbWholeFontBBox(rfbFontDataPtr font,
if
(
-
m
[
i
*
5
+
4
]
>
(
*
y2
))
(
*
y2
)
=-
m
[
i
*
5
+
4
];
}
(
*
x2
)
++
;
(
*
y2
)
++
;
}
rfbFontDataPtr
rfbLoadConsoleFont
(
char
*
filename
)
...
...
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