Skip to content

Commit 938a33e

Browse files
committed
fixed issues #197 #198 #199
1 parent 1850fd2 commit 938a33e

File tree

5 files changed

+37
-14
lines changed

5 files changed

+37
-14
lines changed

docs/source/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
author = 'LinkunGao'
2323

2424
# The full version, including alpha/beta/rc tags
25-
release = 'v1.13.29'
25+
release = 'v1.13.30'
2626

2727

2828
# -- General configuration ---------------------------------------------------

docs/source/release/release.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1524,3 +1524,10 @@ const resetMainAreaSize = (factor: number) => {
15241524

15251525
- fixed the load mask function bug.
15261526
- if load a empty mask accidentally, there is no bugs any more!
1527+
1528+
## Release v1.13.30
1529+
1530+
- the display panel doesn't reset to centre after select nrrd contrast images.
1531+
- fixed bugs:
1532+
- Drag panel (right click) response speed too slow.
1533+
- Right click to drag panel not work initially, only work after using zoom. Now everything works well.

src/Scene/baseScene.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,7 @@ export default class baseScene extends commonScene {
201201
this.container.clientWidth,
202202
this.container.clientHeight
203203
);
204+
console.log("resize------------>");
204205
};
205206
render() {
206207
// this.onWindowResize();

src/Utils/nrrd_tool.ts

Lines changed: 26 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,8 @@ export class nrrd_tools {
110110
stepClear: 1,
111111
sizeFoctor: 1,
112112
clearAllFlag: false,
113+
previousPanelL: -99999,
114+
previousPanelT: -99999,
113115
getMask: (
114116
mask: ImageData,
115117
sliceId: number,
@@ -369,6 +371,11 @@ export class nrrd_tools {
369371
return same;
370372
}
371373

374+
/**
375+
* init all painted images for store images
376+
* @param dimensions
377+
*/
378+
372379
private initPaintImages(dimensions: Array<number>) {
373380
// for x slices' marks
374381
for (let i = 0; i < dimensions[0]; i++) {
@@ -573,6 +580,10 @@ export class nrrd_tools {
573580

574581
this.clearDictionary(this.skipSlicesDic);
575582

583+
// this.nrrd_states.previousPanelL = this.nrrd_states.previousPanelT = -99999;
584+
this.displayCanvas.style.left = this.drawingCanvas.style.left = "";
585+
this.displayCanvas.style.top = this.drawingCanvas.style.top = "";
586+
576587
this.backUpDisplaySlices.length = 0;
577588
this.mainPreSlice = undefined;
578589
this.currentShowingSlice = undefined;
@@ -795,14 +806,12 @@ export class nrrd_tools {
795806
*/
796807
this.drawingCanvas.style.zIndex = "10";
797808
this.drawingCanvas.style.position = "absolute";
809+
798810
this.drawingCanvas.width = this.nrrd_states.changedWidth;
799811
this.drawingCanvas.height = this.nrrd_states.changedHeight;
800812
this.drawingCanvas.style.cursor = this.nrrd_states.defaultPaintCursor;
801813
this.drawingCanvas.oncontextmenu = () => false;
802814

803-
// this.displayCanvas.style.left = this.drawingCanvas.style.left = "0px";
804-
// this.displayCanvas.style.top = this.drawingCanvas.style.top = "0px";
805-
806815
/**
807816
* layer1
808817
* it should be hide, so we don't need to add it to mainAreaContainer
@@ -1163,13 +1172,16 @@ export class nrrd_tools {
11631172
passive: false,
11641173
});
11651174

1166-
const handleDragPaintPanel = throttle((e: MouseEvent) => {
1175+
const handleDragPaintPanel = (e: MouseEvent) => {
11671176
this.drawingCanvas.style.cursor = "grabbing";
1177+
this.nrrd_states.previousPanelL = e.clientX - panelMoveInnerX;
1178+
this.nrrd_states.previousPanelT = e.clientY - panelMoveInnerY;
11681179
this.displayCanvas.style.left = this.drawingCanvas.style.left =
1169-
e.clientX - panelMoveInnerX + "px";
1180+
this.nrrd_states.previousPanelL + "px";
11701181
this.displayCanvas.style.top = this.drawingCanvas.style.top =
1171-
e.clientY - panelMoveInnerY + "px";
1172-
}, 80);
1182+
this.nrrd_states.previousPanelT + "px";
1183+
};
1184+
// throttle(, 80);
11731185
const handleDisplayMouseMove = (e: MouseEvent) => {
11741186
this.nrrd_states.Mouse_Over_x = e.offsetX;
11751187
this.nrrd_states.Mouse_Over_y = e.offsetY;
@@ -1268,10 +1280,15 @@ export class nrrd_tools {
12681280
}
12691281
} else if (e.button === 2) {
12701282
rightclicked = true;
1271-
let offsetX = parseInt(this.drawingCanvas.style.left);
1272-
let offsetY = parseInt(this.drawingCanvas.style.top);
1283+
1284+
// let offsetX = parseInt(this.drawingCanvas.style.left);
1285+
// let offsetY = parseInt(this.drawingCanvas.style.top);
1286+
let offsetX = this.drawingCanvas.offsetLeft;
1287+
let offsetY = this.drawingCanvas.offsetTop;
1288+
12731289
panelMoveInnerX = e.clientX - offsetX;
12741290
panelMoveInnerY = e.clientY - offsetY;
1291+
12751292
this.drawingCanvas.style.cursor = "grab";
12761293
this.drawingCanvas.addEventListener("pointerup", handlePointerUp);
12771294
this.drawingCanvas.addEventListener(
@@ -1875,8 +1892,6 @@ export class nrrd_tools {
18751892
this.displayCanvas.style.left = this.drawingCanvas.style.left = l + "px";
18761893
this.displayCanvas.style.top = this.drawingCanvas.style.top = t + "px";
18771894
} else {
1878-
this.displayCanvas.style.left = this.drawingCanvas.style.left = "";
1879-
this.displayCanvas.style.top = this.drawingCanvas.style.top = "";
18801895
this.mainAreaContainer.style.justifyContent = "center";
18811896
this.mainAreaContainer.style.alignItems = "center";
18821897
}

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.29";
39+
export const REVISION = "v1.13.30";
4040

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

0 commit comments

Comments
 (0)