zincjs 1.8.1 → 1.8.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zincjs",
3
- "version": "1.8.1",
3
+ "version": "1.8.2",
4
4
  "description": "ZincJS (Web-based-Zinc-Visualisation)",
5
5
  "main": "build/zinc.js",
6
6
  "directories": {
package/src/controls.js CHANGED
@@ -349,20 +349,22 @@ const CameraControls = function ( object, domElement, renderer, scene ) {
349
349
 
350
350
  const onDocumentMouseMove = event => {
351
351
  updateRect(false);
352
- this.pointer_x = event.clientX - rect.left;
353
- this.pointer_y = event.clientY - rect.top;
354
- if (currentMode === MODE.MINIMAP) {
355
- let minimapCoordinates = this.scene.getNormalisedMinimapCoordinates(this.renderer, event);
356
- if (minimapCoordinates) {
357
- let translation = this.scene.getMinimapDiffFromNormalised(
358
- minimapCoordinates.x, minimapCoordinates.y);
359
- translateViewport(translation);
360
- }
361
- } else {
362
- if ((this._state === STATE.NONE) && (zincRayCaster !== undefined)) {
363
- zincRayCaster.move(this, event.clientX, event.clientY, this.renderer);
364
- }
365
- }
352
+ if (rect) {
353
+ this.pointer_x = event.clientX - rect.left;
354
+ this.pointer_y = event.clientY - rect.top;
355
+ if (currentMode === MODE.MINIMAP) {
356
+ let minimapCoordinates = this.scene.getNormalisedMinimapCoordinates(this.renderer, event);
357
+ if (minimapCoordinates) {
358
+ let translation = this.scene.getMinimapDiffFromNormalised(
359
+ minimapCoordinates.x, minimapCoordinates.y);
360
+ translateViewport(translation);
361
+ }
362
+ } else {
363
+ if ((this._state === STATE.NONE) && (zincRayCaster !== undefined)) {
364
+ zincRayCaster.move(this, event.clientX, event.clientY, this.renderer);
365
+ }
366
+ }
367
+ }
366
368
  }
367
369
 
368
370
  const onDocumentMouseUp = event => {