early-out if event undefined

This commit is contained in:
David Back 2018-07-03 12:39:41 -07:00
parent 8f838397a4
commit ed4d0f2577

View file

@ -1654,6 +1654,10 @@ SelectionDisplay = (function() {
return (origin.y - intersection.y) / Vec3.distance(origin, intersection);
},
onMove: function(event) {
if (event.x === undefined || event.y === undefined) {
return;
}
var wantDebug = false;
var pickRay = generalComputePickRay(event.x, event.y);
@ -1811,6 +1815,10 @@ SelectionDisplay = (function() {
pushCommandForSelections(duplicatedEntityIDs);
},
onMove: function(event) {
if (event.x === undefined || event.y === undefined) {
return;
}
var pickRay = generalComputePickRay(event.x, event.y);
// Use previousPickRay if new pickRay will cause resulting rayPlaneIntersection values to wrap around
@ -2060,7 +2068,11 @@ SelectionDisplay = (function() {
pushCommandForSelections();
};
var onMove = function(event) {
var onMove = function(event)
if (event.x === undefined || event.y === undefined) {
return;
}
var proportional = (spaceMode === SPACE_WORLD) || directionEnum === STRETCH_DIRECTION.ALL;
var position, rotation;
@ -2393,6 +2405,10 @@ SelectionDisplay = (function() {
// EARLY EXIT
return;
}
if (event.x === undefined || event.y === undefined) {
return;
}
var wantDebug = false;
if (wantDebug) {