@cornerstonejs/core 1.70.10 → 1.70.11
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/dist/cjs/init.js +19 -23
- package/dist/cjs/init.js.map +1 -1
- package/dist/esm/init.js +19 -23
- package/dist/esm/init.js.map +1 -1
- package/dist/types/init.d.ts.map +1 -1
- package/dist/umd/index.js +1 -1
- package/dist/umd/index.js.map +1 -1
- package/package.json +2 -2
- package/src/init.ts +22 -30
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cornerstonejs/core",
|
|
3
|
-
"version": "1.70.
|
|
3
|
+
"version": "1.70.11",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "src/index.ts",
|
|
6
6
|
"types": "dist/types/index.d.ts",
|
|
@@ -47,5 +47,5 @@
|
|
|
47
47
|
"type": "individual",
|
|
48
48
|
"url": "https://ohif.org/donate"
|
|
49
49
|
},
|
|
50
|
-
"gitHead": "
|
|
50
|
+
"gitHead": "134a4a19a878fc7d0615403046bc74ed8564ada0"
|
|
51
51
|
}
|
package/src/init.ts
CHANGED
|
@@ -95,15 +95,16 @@ function _hasNorm16TextureSupport() {
|
|
|
95
95
|
return false;
|
|
96
96
|
}
|
|
97
97
|
|
|
98
|
-
function
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
98
|
+
function isIOS() {
|
|
99
|
+
if (/iPad|iPhone|iPod/.test(navigator.platform)) {
|
|
100
|
+
return true;
|
|
101
|
+
} else {
|
|
102
|
+
return (
|
|
103
|
+
navigator.maxTouchPoints &&
|
|
104
|
+
navigator.maxTouchPoints > 2 &&
|
|
105
|
+
/MacIntel/.test(navigator.platform)
|
|
106
|
+
);
|
|
107
|
+
}
|
|
107
108
|
}
|
|
108
109
|
|
|
109
110
|
/**
|
|
@@ -123,22 +124,18 @@ async function init(configuration = config): Promise<boolean> {
|
|
|
123
124
|
// merge configs
|
|
124
125
|
config = deepMerge(defaultConfig, configuration);
|
|
125
126
|
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
if (config.isMobile) {
|
|
127
|
+
if (isIOS()) {
|
|
129
128
|
// iOS devices don't have support for OES_texture_float_linear
|
|
130
129
|
// and thus we should use native data type if we are on iOS
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
if (
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
);
|
|
141
|
-
}
|
|
130
|
+
config.rendering.useNorm16Texture = _hasNorm16TextureSupport();
|
|
131
|
+
|
|
132
|
+
if (!config.rendering.useNorm16Texture) {
|
|
133
|
+
if (configuration.rendering?.preferSizeOverAccuracy) {
|
|
134
|
+
config.rendering.preferSizeOverAccuracy = true;
|
|
135
|
+
} else {
|
|
136
|
+
console.log(
|
|
137
|
+
'norm16 texture not supported, you can turn on the preferSizeOverAccuracy flag to use native data type, but be aware of the inaccuracy of the rendering in high bits'
|
|
138
|
+
);
|
|
142
139
|
}
|
|
143
140
|
}
|
|
144
141
|
}
|
|
@@ -201,16 +198,11 @@ function setPreferSizeOverAccuracy(status: boolean): void {
|
|
|
201
198
|
* So we should not use float textures on IOS devices.
|
|
202
199
|
*/
|
|
203
200
|
function canRenderFloatTextures(): boolean {
|
|
204
|
-
|
|
205
|
-
if (!isMobile) {
|
|
201
|
+
if (!isIOS()) {
|
|
206
202
|
return true;
|
|
207
203
|
}
|
|
208
204
|
|
|
209
|
-
|
|
210
|
-
return false;
|
|
211
|
-
}
|
|
212
|
-
|
|
213
|
-
return true;
|
|
205
|
+
return false;
|
|
214
206
|
}
|
|
215
207
|
|
|
216
208
|
/**
|