Skip to content

Commit 6db9ccd

Browse files
Merge pull request #21 from tolgamizrakci/development
Development
2 parents c3ead03 + e0e7f90 commit 6db9ccd

File tree

2 files changed

+131
-106
lines changed

2 files changed

+131
-106
lines changed

src/components/KonvaStage.jsx

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,13 @@
1-
import React, { Component, createRef } from 'react';
1+
import React, { Component, createRef } from "react";
22
// import PropTypes from 'prop-types';
3-
import {
4-
Stage, Layer, Image, Group,
5-
} from 'react-konva';
6-
import TransformerComponent from './TransformerComponent.jsx';
7-
import Rectangle from './Rectangle.jsx';
3+
import { Stage, Layer, Image, Group } from "react-konva";
4+
import TransformerComponent from "./TransformerComponent.jsx";
5+
import Rectangle from "./Rectangle.jsx";
86

97
class KonvaStage extends Component {
108
state = {
119
x: undefined,
12-
y: undefined,
10+
y: undefined
1311
};
1412

1513
constructor(props) {
@@ -22,7 +20,7 @@ class KonvaStage extends Component {
2220
// (and focusedComponent to change, which we don't want)
2321
// could reuse this logic for affecting state of children array
2422
// ADD CHANG FOCUS CHILD FUNCTIONALITY HERE
25-
handleStageMouseDown = (e) => {
23+
handleStageMouseDown = e => {
2624
// // clicked on stage - cler selection
2725
// if (e.target === e.target.getStage()) {
2826
// this.props.openExpansionPanel({});
@@ -71,13 +69,13 @@ class KonvaStage extends Component {
7169
scaleX,
7270
scaleY,
7371
focusComponent,
74-
focusChild,
72+
focusChild
7573
} = this.props;
7674
const { selectedShapeName } = this.state;
7775

7876
return (
7977
<Stage
80-
ref={(node) => {
78+
ref={node => {
8179
this.stage = node;
8280
}}
8381
onMouseDown={this.handleStageMouseDown}
@@ -88,7 +86,7 @@ class KonvaStage extends Component {
8886
<Group
8987
scaleX={scaleX}
9088
scaleY={scaleY}
91-
ref={(node) => {
89+
ref={node => {
9290
this.group = node;
9391
}}
9492
draggable={draggable}
@@ -99,7 +97,7 @@ class KonvaStage extends Component {
9997
<Rectangle
10098
draggable={child.draggable}
10199
selectedShapeName={selectedShapeName}
102-
key={i + child.componentName}
100+
key={i + `${child.componentName}`}
103101
childId={child.childId}
104102
componentId={focusComponent.id}
105103
x={child.position.x}

0 commit comments

Comments
 (0)