fix: sr module and add URL docs (#3034)

* fix sr module and add docs

* bump version
This commit is contained in:
Alireza authored and GitHub committed 2022-11-23 11:43:46 -05:00
1 parent 024aeae240
commit 32bb7e4c1e
5 files changed
+134 -8

No files matched your search

+2 -2
View File
@@ -43,9 +43,9 @@
},
"dependencies": {
"@babel/runtime": "7.17.9",
"@cornerstonejs/core": "^0.21.4",
"@cornerstonejs/core": "^0.21.5",
"@cornerstonejs/streaming-image-volume-loader": "^0.6.5",
"@cornerstonejs/tools": "^0.29.6",
"@cornerstonejs/tools": "^0.29.8",
"@kitware/vtk.js": "25.9.0",
"html2canvas": "^1.4.1",
"lodash.debounce": "4.0.8",
@@ -79,7 +79,7 @@ class CornerstoneViewportService implements IViewportService {
) {
const viewportInfo = new ViewportInfo(
viewportIndex,
viewportOptions.viewportId
this.getViewportId(viewportIndex)
);
viewportInfo.setElement(elementRef);
this.viewportsInfo.set(viewportIndex, viewportInfo);
@@ -95,6 +95,10 @@ class CornerstoneViewportService implements IViewportService {
return viewportIds;
}
public getViewportId(viewportIndex: number): string {
return `viewport-${viewportIndex}`;
}
/**
* It retrieves the renderingEngine if it does exist, or creates one otherwise
* @returns {RenderingEngine} rendering engine
@@ -173,6 +177,11 @@ class CornerstoneViewportService implements IViewportService {
): void {
const renderingEngine = this.getRenderingEngine();
const viewportInfo = this.viewportsInfo.get(viewportIndex);
if (!publicViewportOptions.viewportId) {
publicViewportOptions.viewportId = this.getViewportId(viewportIndex);
}
let viewportId = viewportInfo.getViewportId();
// if currently there is a viewport with the viewportId, but it is not the same