zincjs 2.4.1-beta.1 → 2.4.1-beta.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": "2.4.1-beta.1",
3
+ "version": "2.4.1-beta.2",
4
4
  "description": "ZincJS (Web-based-Zinc-Visualisation)",
5
5
  "type": "module",
6
6
  "main": "build/zinc.js",
@@ -28,6 +28,10 @@ const Label = function (textIn, colourIn) {
28
28
  sprite.fontFace = "Asap";
29
29
  sprite.fontSize = 90;
30
30
  sprite.fontWeight = fontWeight;
31
+ const canvasTexture = sprite.material.map; // Snag the canvas texture generated by the library
32
+ sprite.material = new THREE.SpriteNodeMaterial({
33
+ map: canvasTexture,
34
+ });
31
35
  sprite.material.map.generateMipmaps = true;
32
36
  sprite.material.map.anisotropy = 4;
33
37
  sprite.material.minFilter = THREE.LinearMipmapLinearFilter; // Smooth downscaling
package/src/utilities.js CHANGED
@@ -712,6 +712,10 @@ function createNewSpriteText(text, height, colour, font, pixel, weight) {
712
712
  sprite.fontFace = font;
713
713
  sprite.fontSize = pixel;
714
714
  sprite.fontWeight = weight;
715
+ const canvasTexture = sprite.material.map; // Snag the canvas texture generated by the library
716
+ sprite.material = new THREE.SpriteNodeMaterial({
717
+ map: canvasTexture,
718
+ });
715
719
  sprite.material.map.generateMipmaps = true;
716
720
  sprite.material.map.anisotropy = 4;
717
721
  sprite.material.sizeAttenuation = false;