Skip to content
Snippets Groups Projects
Commit 2f1db398 authored by Chris Beer's avatar Chris Beer
Browse files

Move width + height onto the workspace instead of the viewport

parent 9259650f
No related branches found
No related tags found
No related merge requests found
...@@ -10,11 +10,11 @@ function createWrapper(props) { ...@@ -10,11 +10,11 @@ function createWrapper(props) {
windows={{}} windows={{}}
workspace={{ workspace={{
focusedWindowId: 2, focusedWindowId: 2,
width: 5000,
height: 5000,
viewportPosition: { viewportPosition: {
x: 20, x: 20,
y: 20, y: 20,
width: 5000,
height: 5000,
}, },
}} }}
setWorkspaceViewportPosition={() => {}} setWorkspaceViewportPosition={() => {}}
......
...@@ -22,15 +22,15 @@ class WorkspaceElastic extends React.Component { ...@@ -22,15 +22,15 @@ class WorkspaceElastic extends React.Component {
} = this.props; } = this.props;
const { viewportPosition } = workspace; const { viewportPosition } = workspace;
const offsetX = viewportPosition.width / 2; const offsetX = workspace.width / 2;
const offsetY = viewportPosition.height / 2; const offsetY = workspace.height / 2;
return ( return (
<div style={{ position: 'relative', width: '100%', height: '100%' }}> <div style={{ position: 'relative', width: '100%', height: '100%' }}>
<Rnd <Rnd
default={{ default={{
width: viewportPosition.width, width: workspace.width,
height: viewportPosition.height, height: workspace.height,
}} }}
position={{ position={{
x: viewportPosition.x - offsetX, y: viewportPosition.y - offsetY, x: viewportPosition.x - offsetX, y: viewportPosition.y - offsetY,
......
...@@ -8,9 +8,9 @@ export const workspaceReducer = ( ...@@ -8,9 +8,9 @@ export const workspaceReducer = (
viewportPosition: { viewportPosition: {
x: 0, x: 0,
y: 0, y: 0,
},
width: 5000, width: 5000,
height: 5000, height: 5000,
},
exposeModeOn: false, exposeModeOn: false,
}, },
action, action,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment