Skip to content

Commit

Permalink
fix: flag to disable auto resize (#1087)
Browse files Browse the repository at this point in the history
* fix: grab cornerstone instance when called, not module load

Reduces the chance that cornerstone has not yet been registered (resulting in `undef`)

* fix: flag to disable automatic viewport resizing from window resize events
  • Loading branch information
dannyrb authored Sep 27, 2019
1 parent c50f7aa commit 7415681
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/init.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import windowResizeHandler from './eventListeners/windowResizeHandler.js';
export default function(configuration = {}) {
_addCornerstoneEventListeners();
_initModules();
windowResizeHandler.enable();

// Apply global configuration
const globalConfigurationModule = getModule('globalConfiguration');
Expand All @@ -28,6 +27,10 @@ export default function(configuration = {}) {
globalConfigurationModule.configuration,
configuration
);

if (globalConfigurationModule.configuration.autoResizeViewports) {
windowResizeHandler.enable();
}
}

/**
Expand Down
1 change: 1 addition & 0 deletions src/store/modules/globalConfigurationModule.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ const configuration = {
touchEnabled: true,
globalToolSyncEnabled: false,
showSVGCursors: false,
autoResizeViewports: true,
};

export default {
Expand Down

0 comments on commit 7415681

Please sign in to comment.