@cornerstonejs/core 0.38.0 → 0.39.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/dist/cjs/enums/Events.d.ts +2 -1
- package/dist/cjs/enums/Events.js +1 -0
- package/dist/cjs/enums/Events.js.map +1 -1
- package/dist/cjs/utilities/getVolumeViewportScrollInfo.d.ts +5 -0
- package/dist/cjs/utilities/getVolumeViewportScrollInfo.js +10 -2
- package/dist/cjs/utilities/getVolumeViewportScrollInfo.js.map +1 -1
- package/dist/esm/enums/Events.d.ts +2 -1
- package/dist/esm/enums/Events.js +1 -0
- package/dist/esm/enums/Events.js.map +1 -1
- package/dist/esm/utilities/getVolumeViewportScrollInfo.d.ts +5 -0
- package/dist/esm/utilities/getVolumeViewportScrollInfo.js +10 -2
- package/dist/esm/utilities/getVolumeViewportScrollInfo.js.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/enums/Events.ts +5 -0
- package/src/utilities/getVolumeViewportScrollInfo.ts +11 -5
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cornerstonejs/core",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.39.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/umd/index.js",
|
|
6
6
|
"types": "dist/esm/index.d.ts",
|
|
@@ -51,5 +51,5 @@
|
|
|
51
51
|
"type": "individual",
|
|
52
52
|
"url": "https://ohif.org/donate"
|
|
53
53
|
},
|
|
54
|
-
"gitHead": "
|
|
54
|
+
"gitHead": "efb03afb227a0628c3c056ca762bf061b632c55b"
|
|
55
55
|
}
|
package/src/enums/Events.ts
CHANGED
|
@@ -188,6 +188,11 @@ enum Events {
|
|
|
188
188
|
*/
|
|
189
189
|
GEOMETRY_CACHE_GEOMETRY_ADDED = 'CORNERSTONE_GEOMETRY_CACHE_GEOMETRY_ADDED',
|
|
190
190
|
|
|
191
|
+
/**
|
|
192
|
+
* Triggers when the scroll function is called with a delta that is out of bounds.
|
|
193
|
+
* This is usually for signaling that the user may want a different volume for partially loaded volumes which is meant to optimize memory.
|
|
194
|
+
*/
|
|
195
|
+
VOLUME_SCROLL_OUT_OF_BOUNDS = 'CORNERSTONE_VOLUME_SCROLL_OUT_OF_BOUNDS',
|
|
191
196
|
// IMAGE_CACHE_FULL = 'CORNERSTONE_IMAGE_CACHE_FULL',
|
|
192
197
|
// PRE_RENDER = 'CORNERSTONE_PRE_RENDER',
|
|
193
198
|
// ELEMENT_RESIZED = 'CORNERSTONE_ELEMENT_RESIZED',
|
|
@@ -11,10 +11,8 @@ function getVolumeViewportScrollInfo(
|
|
|
11
11
|
viewport: IVolumeViewport,
|
|
12
12
|
volumeId: string
|
|
13
13
|
) {
|
|
14
|
-
const { sliceRange, spacingInNormalDirection } =
|
|
15
|
-
viewport,
|
|
16
|
-
volumeId
|
|
17
|
-
);
|
|
14
|
+
const { sliceRange, spacingInNormalDirection, camera } =
|
|
15
|
+
getVolumeSliceRangeInfo(viewport, volumeId);
|
|
18
16
|
|
|
19
17
|
const { min, max, current } = sliceRange;
|
|
20
18
|
|
|
@@ -26,7 +24,15 @@ function getVolumeViewportScrollInfo(
|
|
|
26
24
|
const floatingStepNumber = fraction * numScrollSteps;
|
|
27
25
|
const currentStepIndex = Math.round(floatingStepNumber);
|
|
28
26
|
|
|
29
|
-
return {
|
|
27
|
+
return {
|
|
28
|
+
numScrollSteps,
|
|
29
|
+
currentStepIndex,
|
|
30
|
+
sliceRangeInfo: {
|
|
31
|
+
sliceRange,
|
|
32
|
+
spacingInNormalDirection,
|
|
33
|
+
camera,
|
|
34
|
+
},
|
|
35
|
+
};
|
|
30
36
|
}
|
|
31
37
|
|
|
32
38
|
export default getVolumeViewportScrollInfo;
|