Skip to content

Commit 8ac4606

Browse files
authored
Merge pull request #184 from LinkunGao/release/v1.13.19
Release/v1.13.19
2 parents 0a01a16 + 0d6facf commit 8ac4606

File tree

7 files changed

+19
-10
lines changed

7 files changed

+19
-10
lines changed

docs/source/release/release.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1454,4 +1454,11 @@ const resetMainAreaSize = (factor: number) => {
14541454
setTimeout(() => {
14551455
scene?.removePreRenderCallbackFunction(index);
14561456
}, 3000);
1457+
// if we want add the a function again
1458+
setTimeout(() => {
1459+
if ((a as any).id) {
1460+
(a as any).id = undefind;
1461+
}
1462+
index = scene.addPreRenderCallbackFunction(a);
1463+
}, 3000);
14571464
```

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "copper3d_visualisation",
33
"description": "A 3d visualisation package base on threejs provides multiple scenes and Nrrd image load funtion.",
4-
"version": "1.13.18",
4+
"version": "1.13.19",
55
"main": "dist/bundle.umd.js",
66
"moudle": "dist/bundle.esm.js",
77
"types": "dist/types/index.d.ts",

src/Scene/commonSceneMethod.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,16 +44,18 @@ export default class commonScene {
4444
);
4545
this.preRenderCallbackFunctions = {
4646
index: 0,
47-
cache: {},
47+
cache: [],
4848
add(fn) {
4949
if (!fn.id) {
50-
fn.id = ++this.index;
51-
this.cache[fn.id] = fn;
50+
fn.id = this.cache.length;
51+
this.cache.push(fn);
5252
return;
5353
}
5454
},
5555
remove(id) {
56-
if (this.cache[id]) delete this.cache[id];
56+
if (this.cache[id]) {
57+
this.cache.splice(id, 1);
58+
}
5759
},
5860
};
5961
}

src/Scene/copperMScene.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ export default class copperMScene extends commonScene {
7070
this.controls = new OrbitControls(this.camera, this.container);
7171
this.preRenderCallbackFunctions = {
7272
index: 0,
73-
cache: {},
73+
cache: [],
7474
add(fn) {
7575
if (!fn.id) {
7676
fn.id = ++this.index;

src/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,10 @@ import {
3636

3737
import "./css/style.css";
3838

39-
export const REVISION = "v1.13.18";
39+
export const REVISION = "v1.13.19";
4040

4141
console.log(
42-
"%cCopper3D Visualisation %cBeta:v1.13.18",
42+
"%cCopper3D Visualisation %cBeta:v1.13.19",
4343
"padding: 3px;color:white; background:#023047",
4444
"padding: 3px;color:white; background:#f50a25"
4545
);

src/types/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ interface cacheType {
4747
}
4848
interface preRenderCallbackFunctionType {
4949
index: number;
50-
cache: cacheType;
50+
cache: Function[];
5151
add: (fn: any) => void;
5252
remove: (id: number) => void;
5353
}

0 commit comments

Comments
 (0)