diff --git a/__tests__/src/components/WorkspaceElastic.test.js b/__tests__/src/components/WorkspaceElastic.test.js index a4c0b6dd91ee14e4e93fe1f27bc84aa828025b89..500fb666878fd4c9d3489f6ef041fa4392042a4f 100644 --- a/__tests__/src/components/WorkspaceElastic.test.js +++ b/__tests__/src/components/WorkspaceElastic.test.js @@ -10,11 +10,11 @@ function createWrapper(props) { windows={{}} workspace={{ focusedWindowId: 2, + width: 5000, + height: 5000, viewportPosition: { x: 20, y: 20, - width: 5000, - height: 5000, }, }} setWorkspaceViewportPosition={() => {}} diff --git a/src/components/WorkspaceElastic.js b/src/components/WorkspaceElastic.js index 13eb84377c4f9ebbcaed3bd60b222eb5264fd766..f92570c05d4485f4f7866b4520f6693c0bc351e6 100644 --- a/src/components/WorkspaceElastic.js +++ b/src/components/WorkspaceElastic.js @@ -22,15 +22,15 @@ class WorkspaceElastic extends React.Component { } = this.props; const { viewportPosition } = workspace; - const offsetX = viewportPosition.width / 2; - const offsetY = viewportPosition.height / 2; + const offsetX = workspace.width / 2; + const offsetY = workspace.height / 2; return ( <div style={{ position: 'relative', width: '100%', height: '100%' }}> <Rnd default={{ - width: viewportPosition.width, - height: viewportPosition.height, + width: workspace.width, + height: workspace.height, }} position={{ x: viewportPosition.x - offsetX, y: viewportPosition.y - offsetY, diff --git a/src/state/reducers/workspace.js b/src/state/reducers/workspace.js index 2aed2d23fbbdcec81dc4e63ae5c56c9fb8a8cfaf..0db841dc2ac4af71b48b2c8ba1bc4f4f3e81122f 100644 --- a/src/state/reducers/workspace.js +++ b/src/state/reducers/workspace.js @@ -8,9 +8,9 @@ export const workspaceReducer = ( viewportPosition: { x: 0, y: 0, - width: 5000, - height: 5000, }, + width: 5000, + height: 5000, exposeModeOn: false, }, action,