Compare commits

...
Author SHA1 Message Date
ohif-bot c8667fb2d6 chore(release): publish [skip ci]
- @ohif/viewer@1.3.1
2019-10-01 10:07:08 +00:00
Erik Ziegler 674ca9f96f fix: Exit MPR mode if Layout is changed (#984) 2019-10-01 11:55:58 +02:00
3 changed files with 32 additions and 3 deletions

No files matched your search

+11
View File
@@ -3,6 +3,17 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.3.1](https://github.com/OHIF/Viewers/compare/@ohif/viewer@1.3.0...@ohif/viewer@1.3.1) (2019-10-01)
### Bug Fixes
* Exit MPR mode if Layout is changed ([#984](https://github.com/OHIF/Viewers/issues/984)) ([674ca9f](https://github.com/OHIF/Viewers/commit/674ca9f))
# [1.3.0](https://github.com/OHIF/Viewers/compare/@ohif/viewer@1.2.8...@ohif/viewer@1.3.0) (2019-10-01)
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@ohif/viewer",
"version": "1.3.0",
"version": "1.3.1",
"description": "OHIF Viewer",
"author": "OHIF Contributors",
"license": "MIT",
@@ -13,15 +13,23 @@ const mapStateToProps = state => {
const mapDispatchToProps = dispatch => {
return {
// TODO: Change if layout switched becomes more complex
onChange: selectedCell => {
onChange: (selectedCell, currentLayout) => {
let viewports = [];
const rows = selectedCell.row + 1;
const columns = selectedCell.col + 1;
const numViewports = rows * columns;
for (let i = 0; i < numViewports; i++) {
// Hacky way to allow users to exit MPR "mode"
const viewport = currentLayout.viewports[i];
let plugin = viewport && viewport.plugin;
if (viewport && viewport.vtk) {
plugin = 'cornerstone';
}
viewports.push({
height: `${100 / rows}%`,
width: `${100 / columns}%`,
plugin,
});
}
const layout = {
@@ -33,9 +41,19 @@ const mapDispatchToProps = dispatch => {
};
};
const mergeProps = (propsFromState, propsFromDispatch) => {
const onChangeFromDispatch = propsFromDispatch.onChange;
const { currentLayout } = propsFromState;
return {
onChange: (selectedCell) => onChangeFromDispatch(selectedCell, currentLayout)
};
}
const ConnectedLayoutButton = connect(
mapStateToProps,
mapDispatchToProps
mapDispatchToProps,
mergeProps
)(LayoutButton);
export default ConnectedLayoutButton;