Skip to content

Commit

Permalink
Merge pull request #184 from LinkunGao/release/v1.13.19
Browse files Browse the repository at this point in the history
Release/v1.13.19
  • Loading branch information
LinkunGao authored Feb 22, 2023
2 parents 0a01a16 + 0d6facf commit 8ac4606
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 10 deletions.
7 changes: 7 additions & 0 deletions docs/source/release/release.md
Original file line number Diff line number Diff line change
Expand Up @@ -1454,4 +1454,11 @@ const resetMainAreaSize = (factor: number) => {
setTimeout(() => {
scene?.removePreRenderCallbackFunction(index);
}, 3000);
// if we want add the a function again
setTimeout(() => {
if ((a as any).id) {
(a as any).id = undefind;
}
index = scene.addPreRenderCallbackFunction(a);
}, 3000);
```
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "copper3d_visualisation",
"description": "A 3d visualisation package base on threejs provides multiple scenes and Nrrd image load funtion.",
"version": "1.13.18",
"version": "1.13.19",
"main": "dist/bundle.umd.js",
"moudle": "dist/bundle.esm.js",
"types": "dist/types/index.d.ts",
Expand Down
10 changes: 6 additions & 4 deletions src/Scene/commonSceneMethod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,16 +44,18 @@ export default class commonScene {
);
this.preRenderCallbackFunctions = {
index: 0,
cache: {},
cache: [],
add(fn) {
if (!fn.id) {
fn.id = ++this.index;
this.cache[fn.id] = fn;
fn.id = this.cache.length;
this.cache.push(fn);
return;
}
},
remove(id) {
if (this.cache[id]) delete this.cache[id];
if (this.cache[id]) {
this.cache.splice(id, 1);
}
},
};
}
Expand Down
2 changes: 1 addition & 1 deletion src/Scene/copperMScene.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ export default class copperMScene extends commonScene {
this.controls = new OrbitControls(this.camera, this.container);
this.preRenderCallbackFunctions = {
index: 0,
cache: {},
cache: [],
add(fn) {
if (!fn.id) {
fn.id = ++this.index;
Expand Down
4 changes: 2 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@ import {

import "./css/style.css";

export const REVISION = "v1.13.18";
export const REVISION = "v1.13.19";

console.log(
"%cCopper3D Visualisation %cBeta:v1.13.18",
"%cCopper3D Visualisation %cBeta:v1.13.19",
"padding: 3px;color:white; background:#023047",
"padding: 3px;color:white; background:#f50a25"
);
Expand Down
2 changes: 1 addition & 1 deletion src/types/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ interface cacheType {
}
interface preRenderCallbackFunctionType {
index: number;
cache: cacheType;
cache: Function[];
add: (fn: any) => void;
remove: (id: number) => void;
}
Expand Down

0 comments on commit 8ac4606

Please sign in to comment.