Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Aayush
purr-data
Commits
cc5dbd2e
Commit
cc5dbd2e
authored
Dec 12, 2015
by
Jonathan Wilkes
Browse files
don't send a mouse event to Pd when the scrollbars are clicked
parent
0c8a51ed
Changes
1
Hide whitespace changes
Inline
Side-by-side
pd/nw/pd_canvas.js
View file @
cc5dbd2e
...
...
@@ -94,6 +94,16 @@ var canvas_events = (function() {
textbox
=
function
()
{
return
document
.
getElementById
(
"
new_object_textentry
"
);
},
target_is_scrollbar
=
function
(
evt
)
{
// Don't send the event to Pd if we click on the scrollbars.
// This is a bit fragile because we're suppressing on
// HTMLHtmlElement which is too broad...
if
(
evt
.
target
.
constructor
.
name
===
"
HTMLHtmlElement
"
)
{
return
1
;
}
else
{
return
0
;
}
},
events
=
{
mousemove
:
function
(
evt
)
{
//pdgui.post("x: " + evt.pageX + " y: " + evt.pageY +
...
...
@@ -108,6 +118,9 @@ var canvas_events = (function() {
return
false
;
},
mousedown
:
function
(
evt
)
{
if
(
target_is_scrollbar
(
evt
))
{
return
;
}
// tk events (and, therefore, Pd evnets) are one greater
// than html5...
var
b
=
evt
.
button
+
1
;
...
...
@@ -269,7 +282,7 @@ var canvas_events = (function() {
return
false
;
},
text_mousedown
:
function
(
evt
)
{
if
(
textbox
()
!==
evt
.
target
)
{
if
(
textbox
()
!==
evt
.
target
&&
!
target_is_scrollbar
(
evt
)
)
{
// Yes: I _really_ want .innerText and NOT .textContent
// here. I want those newlines: although that isn't
// standard in Pd-Vanilla, Pd-l2ork uses and preserves
...
...
@@ -314,6 +327,9 @@ var canvas_events = (function() {
return
false
;
},
floating_text_click
:
function
(
evt
)
{
if
(
target_is_scrollbar
(
evt
))
{
return
;
}
//pdgui.post("leaving floating mode");
canvas_events
.
text
();
evt
.
stopPropagation
();
...
...
Write
Preview
Supports
Markdown
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