babylonjs-editor-tools 0.0.6 → 0.0.7

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.
Files changed (2) hide show
  1. package/build/texture.js +13 -4
  2. package/package.json +2 -2
package/build/texture.js CHANGED
@@ -12,16 +12,25 @@ decorators_serialization_1.SerializationHelper._TextureParser = (sourceProperty,
12
12
  }
13
13
  const width = sourceProperty.metadata.baseSize.width;
14
14
  const height = sourceProperty.metadata.baseSize.height;
15
+ const isPowerOfTwo = width === (0, scalar_1.getPowerOfTwoUntil)(width) || height === (0, scalar_1.getPowerOfTwoUntil)(height);
15
16
  let suffix = "";
16
17
  switch (scene.loadingQuality) {
17
18
  case "medium":
18
- const midWidth = (0, scalar_1.getPowerOfTwoUntil)(width * 0.66);
19
- const midHeight = (0, scalar_1.getPowerOfTwoUntil)(height * 0.66);
19
+ let midWidth = (width * 0.66) >> 0;
20
+ let midHeight = (height * 0.66) >> 0;
21
+ if (isPowerOfTwo) {
22
+ midWidth = (0, scalar_1.getPowerOfTwoUntil)(midWidth);
23
+ midHeight = (0, scalar_1.getPowerOfTwoUntil)(midHeight);
24
+ }
20
25
  suffix = `_${midWidth}_${midHeight}`;
21
26
  break;
22
27
  case "low":
23
- const lowWidth = (0, scalar_1.getPowerOfTwoUntil)(width * 0.33);
24
- const lowHeight = (0, scalar_1.getPowerOfTwoUntil)(height * 0.33);
28
+ let lowWidth = (width * 0.33) >> 0;
29
+ let lowHeight = (height * 0.33) >> 0;
30
+ if (isPowerOfTwo) {
31
+ lowWidth = (0, scalar_1.getPowerOfTwoUntil)(lowWidth);
32
+ lowHeight = (0, scalar_1.getPowerOfTwoUntil)(lowHeight);
33
+ }
25
34
  suffix = `_${lowWidth}_${lowHeight}`;
26
35
  break;
27
36
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "babylonjs-editor-tools",
3
- "version": "0.0.6",
3
+ "version": "0.0.7",
4
4
  "description": "Babylon.js Editor Tools is a set of tools to help you create, edit and manage your Babylon.js scenes made using the Babylon.JS Editor",
5
5
  "productName": "Babylon.js Editor Tools",
6
6
  "scripts": {
@@ -10,7 +10,7 @@
10
10
  "typings": "declaration/index.ts",
11
11
  "license": "(Apache-2.0)",
12
12
  "devDependencies": {
13
- "@babylonjs/core": "7.0.0",
13
+ "@babylonjs/core": "7.15.1",
14
14
  "typescript": "5.3.3"
15
15
  },
16
16
  "dependencies": {}