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

Renders wrong after clone(), with a rotation attr #237

Open
wolframkriesing opened this issue Apr 14, 2017 · 0 comments
Open

Renders wrong after clone(), with a rotation attr #237

wolframkriesing opened this issue Apr 14, 2017 · 0 comments

Comments

@wolframkriesing
Copy link
Member

The following example should render the same shape in both pieces of code.
Unfortunately the second one screws up the matrix.

var rect = new Rect(100, 100, 100, 100).attr({fillColor: 'red', rotation: 0.78, scaleY: 2});
rect
  .addTo(stage);

// renders different to

var rect = new Rect(100, 100, 100, 100).attr({fillColor: 'red', rotation: 0.78, scaleY: 2});
rect
  .clone({attributes: true})
  .addTo(stage);

A workaround (as long as there is no fix) is to duplicate the matrix too. Like so:

var rect = new Rect(100, 100, 100, 100).attr({fillColor: 'red', rotation: 0.78, scaleY: 2});
rect
  .clone({attributes: true})
  .attr({matrix: rect.attr().matrix}) // this is the workaround, remove it and it renders wrong
  .addTo(stage);
@wolframkriesing wolframkriesing changed the title Path.clone() renders wrongly with a rotation attr Renders wrong after clone(), with a rotation attr Apr 14, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant