Skip to content

dragging changes #20

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

Merged
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
4 changes: 2 additions & 2 deletions src/actions/components.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,13 +130,13 @@ export const handleClose = () => ({
payload: false,
});

export const handleTransform = (componentId, id, {
export const handleTransform = (componentId, childId, {
x, y, width, height,
}) => ({
type: HANDLE_TRANSFORM,
payload: {
componentId,
id,
childId,
x,
y,
width,
Expand Down
2 changes: 1 addition & 1 deletion src/components/KonvaStage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class KonvaStage extends Component {
// Christian - this function causes the expansionPanel of the clicked rect to open
// (and focusedComponent to change, which we don't want)
// could reuse this logic for affecting state of children array
// ADD FOCUS CHILD FUNCTIONALITY HERE
// ADD CHANG FOCUS CHILD FUNCTIONALITY HERE
handleStageMouseDown = (e) => {
// // clicked on stage - cler selection
// if (e.target === e.target.getStage()) {
Expand Down
30 changes: 16 additions & 14 deletions src/utils/componentReducer.util.js
Original file line number Diff line number Diff line change
Expand Up @@ -321,20 +321,22 @@ export const handleTransform = (state, {
}) => {
console.log('componentId and childId: ', componentId, childId);
console.log('state.focuscomponent: ', state.focusComponent);
// const components = state.components.map((component) => {
// if (component.id === id) {
// return {
// ...component,
// position: {
// x,
// y,
// width,
// height,
// },
// };
// }
// return component;
// });
// const components = state.components
// .find(comp => comp.id === componentId)
// .childrenArray.map((child) => {
// if (child.childId === childId) {
// return {
// ...child,
// position: {
// x,
// y,
// width,
// height,
// },
// };
// }
// return child;
// });
return {
...state,
// components,
Expand Down