Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
N
noVNC
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
noVNC
Commits
ca9a9964
Commit
ca9a9964
authored
Jun 13, 2013
by
Phil Driscoll
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix onMouseDisable so that clicks outside the canvas are propagated
parent
8f12ca7a
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
6 deletions
+8
-6
input.js
include/input.js
+3
-3
util.js
include/util.js
+5
-3
No files found.
include/input.js
View file @
ca9a9964
...
...
@@ -611,9 +611,9 @@ function onMouseDisable(e) {
evt
=
(
e
?
e
:
window
.
event
);
pos
=
Util
.
getEventPosition
(
e
,
conf
.
target
,
conf
.
scale
);
/* Stop propagation if inside canvas area */
if
((
pos
.
x
>=
0
)
&&
(
pos
.
y
>=
0
)
&&
(
pos
.
x
<
conf
.
target
.
offsetWidth
)
&&
(
pos
.
y
<
conf
.
target
.
offsetHeight
))
{
if
((
pos
.
realx
>=
0
)
&&
(
pos
.
real
y
>=
0
)
&&
(
pos
.
real
x
<
conf
.
target
.
offsetWidth
)
&&
(
pos
.
real
y
<
conf
.
target
.
offsetHeight
))
{
//Util.Debug("mouse event disabled");
Util
.
stopEvent
(
e
);
return
false
;
...
...
include/util.js
View file @
ca9a9964
...
...
@@ -298,9 +298,11 @@ Util.getEventPosition = function (e, obj, scale) {
if
(
typeof
scale
===
"undefined"
)
{
scale
=
1
;
}
var
x
=
Math
.
max
(
Math
.
min
(
docX
-
pos
.
x
,
obj
.
width
-
1
),
0
);
var
y
=
Math
.
max
(
Math
.
min
(
docY
-
pos
.
y
,
obj
.
height
-
1
),
0
);
return
{
'x'
:
x
/
scale
,
'y'
:
y
/
scale
};
var
realx
=
docX
-
pos
.
x
;
var
realy
=
docY
-
pos
.
y
;
var
x
=
Math
.
max
(
Math
.
min
(
realx
,
obj
.
width
-
1
),
0
);
var
y
=
Math
.
max
(
Math
.
min
(
realy
,
obj
.
height
-
1
),
0
);
return
{
'x'
:
x
/
scale
,
'y'
:
y
/
scale
,
'realx'
:
realx
/
scale
,
'realy'
:
realy
/
scale
};
};
...
...
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