zincjs 2.2.1 → 2.3.0
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/build/zinc.js +2 -2
- package/build/zinc.js.map +1 -1
- package/package.json +6 -2
- package/src/primitives/label.js +6 -1
- package/src/utilities.js +2 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "zincjs",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.3.0",
|
|
4
4
|
"description": "ZincJS (Web-based-Zinc-Visualisation)",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "build/zinc.js",
|
|
@@ -46,7 +46,11 @@
|
|
|
46
46
|
},
|
|
47
47
|
"homepage": "http://alan-wu.github.io/ZincJS/",
|
|
48
48
|
"engines": {
|
|
49
|
-
"node": "
|
|
49
|
+
"node": "24.20.0"
|
|
50
|
+
},
|
|
51
|
+
"allowScripts": {
|
|
52
|
+
"gl@8.1.6": true,
|
|
53
|
+
"msw@2.14.6": true
|
|
50
54
|
},
|
|
51
55
|
"devDependencies": {
|
|
52
56
|
"@vitest/coverage-v8": "^4.1.11",
|
package/src/primitives/label.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import * as THREE from 'three';
|
|
1
2
|
import SpriteTextModule from 'three-spritetext';
|
|
2
3
|
const SpriteText = SpriteTextModule.default || SpriteTextModule;
|
|
3
4
|
|
|
@@ -24,8 +25,12 @@ const Label = function (textIn, colourIn) {
|
|
|
24
25
|
else
|
|
25
26
|
sprite = new SpriteText(text, 0.012);
|
|
26
27
|
sprite.fontFace = "Asap";
|
|
28
|
+
sprite.fontSize = 90;
|
|
27
29
|
sprite.fontWeight = fontWeight;
|
|
28
|
-
sprite.material.map.generateMipmaps =
|
|
30
|
+
sprite.material.map.generateMipmaps = true;
|
|
31
|
+
sprite.material.map.anisotropy = 4;
|
|
32
|
+
sprite.material.minFilter = THREE.LinearMipmapLinearFilter; // Smooth downscaling
|
|
33
|
+
sprite.material.magFilter = THREE.LinearFilter;
|
|
29
34
|
sprite.material.sizeAttenuation = false;
|
|
30
35
|
sprite.center.x = -0.05;
|
|
31
36
|
sprite.center.y = 0;
|
package/src/utilities.js
CHANGED
|
@@ -732,10 +732,11 @@ function getCircularTexture() {
|
|
|
732
732
|
|
|
733
733
|
function createNewSpriteText(text, height, colour, font, pixel, weight) {
|
|
734
734
|
const sprite = new SpriteText(text, height, colour, font, pixel, weight);
|
|
735
|
+
sprite.canvasScale = 4;
|
|
735
736
|
sprite.fontFace = font;
|
|
736
737
|
sprite.fontSize = pixel;
|
|
737
738
|
sprite.fontWeight = weight;
|
|
738
|
-
sprite.material.map.generateMipmaps =
|
|
739
|
+
sprite.material.map.generateMipmaps = true;
|
|
739
740
|
sprite.material.map.anisotropy = 4;
|
|
740
741
|
sprite.material.sizeAttenuation = false;
|
|
741
742
|
sprite.material.alphaTest = 0.5;
|