zincjs 1.10.0 → 1.10.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.10.0",
3
+ "version": "1.10.2",
4
4
  "description": "ZincJS (Web-based-Zinc-Visualisation)",
5
5
  "main": "build/zinc.js",
6
6
  "directories": {
package/src/controls.js CHANGED
@@ -1561,8 +1561,10 @@ const RayCaster = function (sceneIn, hostSceneIn, callbackFunctionIn, hoverCallb
1561
1561
  let zincObject = pickedObjects[i].object ? pickedObjects[i].object.userData : undefined;
1562
1562
  if (zincObject && zincObject.isMarkerCluster && zincObject.visible
1563
1563
  && zincObject.clusterIsVisible(pickedObjects[i].object.clusterIndex)) {
1564
- zincObject.zoomToCluster(pickedObjects[i].object.clusterIndex);
1565
- return;
1564
+ //Can zoom into cluster
1565
+ if (zincObject.zoomToCluster(pickedObjects[i].object.clusterIndex)) {
1566
+ return;
1567
+ }
1566
1568
  }
1567
1569
  }
1568
1570
  callbackFunction(pickedObjects, x, y);
@@ -213,10 +213,14 @@ const MarkerCluster = function(sceneIn) {
213
213
  if (index !== undefined && index > -1) {
214
214
  this._v1.set(...sprites[index].min);
215
215
  this._v2.set(...sprites[index].max);
216
- this._b1.set(this._v1, this._v2);
217
- scene.translateBoundingBoxToCameraView(this._b1, 3, 300);
218
- this.markerUpdateRequired = true;
216
+ if (Math.abs(this._v1.distanceTo(this._v2) > 0.0)) {
217
+ this._b1.set(this._v1, this._v2);
218
+ scene.translateBoundingBoxToCameraView(this._b1, 3, 300);
219
+ this.markerUpdateRequired = true;
220
+ return true;
221
+ }
219
222
  }
223
+ return false;
220
224
  }
221
225
 
222
226
  this.clusterIsVisible = (index) => {
@@ -766,9 +766,11 @@ Geometry.prototype = Object.assign( Object.create( EventDispatcher.prototype ),
766
766
  // colors
767
767
 
768
768
  for ( let i = 0, il = colors2.length; i < il; i ++ ) {
769
-
770
- colors1.push( colors2[ i ].clone() );
771
-
769
+ if ((typeof colors2[ i ] === "number")) {
770
+ colors1.push( colors2[ i ] );
771
+ } else {
772
+ colors1.push( colors2[ i ].clone() );
773
+ }
772
774
  }
773
775
 
774
776
  // faces