lore-engine
Advanced tools
Comparing version 1.1.46 to 1.1.48
@@ -79,3 +79,3 @@ (function () { | ||
} else if (e.keyCode == 55) { | ||
} else if (e.keyCode == 56) { | ||
@@ -82,0 +82,0 @@ |
{ | ||
"name": "lore-engine", | ||
"version": "1.1.46", | ||
"version": "1.1.48", | ||
"description": "A WebGL based 3D data visualization engine.", | ||
@@ -5,0 +5,0 @@ "main": "./app.js", |
@@ -74,3 +74,3 @@ //@ts-check | ||
this.canvas.addEventListener("pointermove", function(e) { | ||
this.canvas.addEventListener("pointermove", function (e) { | ||
// Find this event in the cache and update its record with this event | ||
@@ -83,6 +83,6 @@ for (var i = 0; i < that.mouse.pointerCache.length; i++) { | ||
} | ||
// Get the current average / center of mass pointer location | ||
let pointerLoc = that.getPointerLocation(); | ||
// Handle touch gestures and mouse events | ||
@@ -92,3 +92,3 @@ // If there are two pointer events, it has to be touch | ||
var diff = Math.pow(that.mouse.pointerCache[1].clientX - that.mouse.pointerCache[0].clientX, 2) + | ||
Math.pow(that.mouse.pointerCache[1].clientY - that.mouse.pointerCache[0].clientY, 2); | ||
Math.pow(that.mouse.pointerCache[1].clientY - that.mouse.pointerCache[0].clientY, 2); | ||
@@ -123,4 +123,4 @@ if (that.mouse.pinchDiff > 0) { | ||
that.mouse.previousPosition.x !== null && (that.mouse.state.left || | ||
that.mouse.state.middle || | ||
that.mouse.state.right) | ||
that.mouse.state.middle || | ||
that.mouse.state.right) | ||
) { | ||
@@ -155,6 +155,6 @@ that.mouse.delta.x = pointerLoc[0] - that.mouse.previousPosition.x; | ||
that.mouse.normalizedPosition.x = | ||
((e.clientX - rect.left * s) / that.canvas.width) * s * 2 - 1; | ||
((e.clientX - rect.left) / that.canvas.width) * s * 2 - 1; | ||
that.mouse.normalizedPosition.y = | ||
-(((e.clientY - rect.top * s) / that.canvas.height) * s) * 2 + 1; | ||
-(((e.clientY - rect.top) / that.canvas.height) * s) * 2 + 1; | ||
that.raiseEvent("mousemove", { | ||
@@ -172,3 +172,3 @@ e: that | ||
this.canvas.addEventListener(wheelevent, function(e) { | ||
this.canvas.addEventListener(wheelevent, function (e) { | ||
if (that.isInIframe() && !e.ctrlKey) { | ||
@@ -186,3 +186,3 @@ return; | ||
this.canvas.addEventListener("keydown", function(e) { | ||
this.canvas.addEventListener("keydown", function (e) { | ||
if (e.which == 16) { | ||
@@ -201,3 +201,3 @@ that.keyboard.shift = true; | ||
this.canvas.addEventListener("keyup", function(e) { | ||
this.canvas.addEventListener("keyup", function (e) { | ||
if (e.which == 16) { | ||
@@ -216,3 +216,3 @@ that.keyboard.shift = false; | ||
this.canvas.addEventListener("pointerdown", function(e) { | ||
this.canvas.addEventListener("pointerdown", function (e) { | ||
let btn = e.button; | ||
@@ -242,6 +242,6 @@ let source = "left"; | ||
this.canvas.addEventListener("click", function(e) { | ||
this.canvas.addEventListener("click", function (e) { | ||
let btn = e.button; | ||
let source = "left"; | ||
if (!that.mouse.moved) { | ||
@@ -252,6 +252,6 @@ that.raiseEvent("click", { | ||
}); | ||
} | ||
} | ||
}); | ||
this.canvas.addEventListener("dblclick", function(e) { | ||
this.canvas.addEventListener("dblclick", function (e) { | ||
let btn = e.button; | ||
@@ -267,3 +267,3 @@ let source = "left"; | ||
// This function is added to multiple pointer events | ||
let pointerUpEvent = function(e) { | ||
let pointerUpEvent = function (e) { | ||
let btn = e.button; | ||
@@ -300,11 +300,11 @@ let source = "left"; | ||
this.canvas.addEventListener("pointerup", function(e) { | ||
this.canvas.addEventListener("pointerup", function (e) { | ||
pointerUpEvent(e); | ||
}); | ||
this.canvas.addEventListener("pointercancel", function(e) { | ||
this.canvas.addEventListener("pointercancel", function (e) { | ||
pointerUpEvent(e); | ||
}); | ||
this.canvas.addEventListener("pointerleave", function(e) { | ||
this.canvas.addEventListener("pointerleave", function (e) { | ||
pointerUpEvent(e); | ||
@@ -311,0 +311,0 @@ }); |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
47697322