Skip to content

The size property won't work #9

@ck97756

Description

@ck97756

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions