Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Swap styles faster in the frame viewer #1452

Merged
merged 1 commit into from
Jan 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
- Bypass some scaling code when compositing multi sources ([#1447](../../pull/1447), [#1449](../../pull/1449))
- Do not create needless alpha bands in the multi source ([#1451](../../pull/1451))
- Infer DICOM file size, when possible ([#1448](../../pull/1448))
- Swap styles faster in the frame viewer ([#1452](../../pull/1452))

## 1.27.1

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -175,10 +175,25 @@
frame = frame || 0;
this._nextframe = frame;
this._nextstyle = style;
if ((frame !== this._frame || style !== this._style) && !this._updating) {
if ((frame !== this._frame || style !== this._style)) {
this._frame = frame;
this._style = style;
this.trigger('g:imageFrameChanging', this, frame);
if (this._updating) {
this._layer2.url(this.getFrameAndUrl().url);

Check warning on line 183 in girder/girder_large_image/web_client/views/imageViewerWidget/geojs.js

View check run for this annotation

Codecov / codecov/patch

girder/girder_large_image/web_client/views/imageViewerWidget/geojs.js#L183

Added line #L183 was not covered by tests
if (this._style === undefined) {
if (this._layer2.setFrameQuad) {
this._layer2.setFrameQuad(frame);

Check warning on line 186 in girder/girder_large_image/web_client/views/imageViewerWidget/geojs.js

View check run for this annotation

Codecov / codecov/patch

girder/girder_large_image/web_client/views/imageViewerWidget/geojs.js#L186

Added line #L186 was not covered by tests
}
this._layer2.frame = frame;

Check warning on line 188 in girder/girder_large_image/web_client/views/imageViewerWidget/geojs.js

View check run for this annotation

Codecov / codecov/patch

girder/girder_large_image/web_client/views/imageViewerWidget/geojs.js#L188

Added line #L188 was not covered by tests
} else {
if (this._layer2.setFrameQuad) {
this._layer2.setFrameQuad(undefined);

Check warning on line 191 in girder/girder_large_image/web_client/views/imageViewerWidget/geojs.js

View check run for this annotation

Codecov / codecov/patch

girder/girder_large_image/web_client/views/imageViewerWidget/geojs.js#L191

Added line #L191 was not covered by tests
}
this._layer2.frame = undefined;

Check warning on line 193 in girder/girder_large_image/web_client/views/imageViewerWidget/geojs.js

View check run for this annotation

Codecov / codecov/patch

girder/girder_large_image/web_client/views/imageViewerWidget/geojs.js#L193

Added line #L193 was not covered by tests
}
return;

Check warning on line 195 in girder/girder_large_image/web_client/views/imageViewerWidget/geojs.js

View check run for this annotation

Codecov / codecov/patch

girder/girder_large_image/web_client/views/imageViewerWidget/geojs.js#L195

Added line #L195 was not covered by tests
}
const quadLoaded = ((this._layer.setFrameQuad || {}).status || {}).loaded;
if (quadLoaded && this._style === undefined) {
this._layer.url(this.getFrameAndUrl().url);
Expand All @@ -194,7 +209,7 @@
this._layer.frame = undefined;
}
this._updating = true;
this.viewer.onIdle(() => {
this._layer.onIdle(() => {

Check warning on line 212 in girder/girder_large_image/web_client/views/imageViewerWidget/geojs.js

View check run for this annotation

Codecov / codecov/patch

girder/girder_large_image/web_client/views/imageViewerWidget/geojs.js#L212

Added line #L212 was not covered by tests
this._layer2.url(this.getFrameAndUrl().url);
if (this._style === undefined) {
if (this._layer2.setFrameQuad) {
Expand All @@ -207,7 +222,7 @@
}
this._layer2.frame = undefined;
}
this.viewer.onIdle(() => {
this._layer2.onIdle(() => {

Check warning on line 225 in girder/girder_large_image/web_client/views/imageViewerWidget/geojs.js

View check run for this annotation

Codecov / codecov/patch

girder/girder_large_image/web_client/views/imageViewerWidget/geojs.js#L225

Added line #L225 was not covered by tests
if (this._layer.zIndex() > this._layer2.zIndex()) {
this._layer.moveDown();
if (!this._layer.options.keepLower) {
Expand Down