Skip to content

Commit 9392cb7

Browse files
committed
Merge pull request #4 from gl-vis/click-event
Add support for click handlers from selections
2 parents c42cd98 + 9b11fe9 commit 9392cb7

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

scene.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -337,6 +337,7 @@ function createScene(options) {
337337
var numPick = pickBuffers.length
338338
var numObjs = objects.length
339339
var prevObj = selection.object
340+
340341
selection.distance = Infinity
341342
selection.mouse[0] = x
342343
selection.mouse[1] = y
@@ -346,7 +347,7 @@ function createScene(options) {
346347

347348
var change = false
348349

349-
if(buttons) {
350+
if(buttons && prevButtons) {
350351
mouseRotating = true
351352
} else {
352353
if(mouseRotating) {
@@ -367,6 +368,7 @@ function createScene(options) {
367368
}
368369
var objPick = obj.pick(result)
369370
if(objPick) {
371+
selection.buttons = buttons
370372
selection.screen = result.coord
371373
selection.distance = result.distance
372374
selection.object = obj
@@ -380,6 +382,7 @@ function createScene(options) {
380382
}
381383
}
382384
}
385+
383386
if(prevObj && prevObj !== selection.object) {
384387
if(prevObj.highlight) {
385388
prevObj.highlight(null)

0 commit comments

Comments
 (0)