[go: up one dir, main page]

Skip to content
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

The size property won't work #9

Open
ck97756 opened this issue Dec 26, 2017 · 2 comments
Open

The size property won't work #9

ck97756 opened this issue Dec 26, 2017 · 2 comments
Labels

Comments

@ck97756
Copy link
ck97756 commented Dec 26, 2017

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

@HriBB
Copy link
Collaborator
HriBB commented Jan 10, 2018

@ck97756 I'm rather busy right now, will take some time to address this issue. You are welcome to open a PR. Check out this piece of code

@HriBB HriBB added the bug label Jan 10, 2018
@HriBB
Copy link
Collaborator
HriBB commented Sep 14, 2022

@ck97756 check out the new version 3 and the examples.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants