Skip to content

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

@wolframkriesing

Description

@wolframkriesing

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);

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions