-
Notifications
You must be signed in to change notification settings - Fork 36
Open
Labels
Description
If I change the endX and endY state in mousemove event
the size of the shape won't change
let shape = null;
let centerX = (this.state.startX + this.state.endX) / 2;
let centerY = (this.state.startY + this.state.endY) / 2;
let width = Math.abs(this.state.endX - this.state.startX);
let height = Math.abs(this.state.endY - this.state.startY);
shape =<Paper.Rectangle center={[centerX, centerY]} size={[width, height]} strokeWidth={4} strokeColor={'#ff0000'} />
return (
<div>
<Paper.View ref={(view) => { this.view = view; }} {...viewProps}>
{shape}
</Paper.View>
</div>
);
It can be fixed by adding a random key property to shape
but it's kind of hacking