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

1.5 regression: iText cursor and selection ignores transform #2122

Closed
tjunnone opened this issue Apr 17, 2015 · 2 comments · Fixed by #2175
Closed

1.5 regression: iText cursor and selection ignores transform #2122

tjunnone opened this issue Apr 17, 2015 · 2 comments · Fixed by #2175
Labels
Milestone

Comments

@tjunnone
Copy link

Fabric.js 1.5.0 renders the cursor and selection for the below IText object incorrectly, ignoring the transformation that is applied to the text. Version 1.4.13 renders both correctly (the bounding box is off in both versions due to issue #1520)

var canvas = new fabric.Canvas('c');
var iText = new fabric.IText("Hello world", {
    transformMatrix: [1, 0.5, -1, 0.5, 0, 0],
    left: 100,
    top: 100
});
canvas.add(iText);

itext-transform-bug

@asturur
Copy link
Member

asturur commented Apr 17, 2015

we are working on transformMatrix general support.

Transform Matrix is not supported with interactivity. Almost every function other than SVG break down if you apply a general transformMatrix on an object outside a pathgroup.

Is still a missing feature. The fact that from 1.5.0 to 1.4.13 they look differnt is because the cursor and selection have been moved to uppercanvas for performance reason.

@asturur
Copy link
Member

asturur commented Apr 17, 2015

If you want is easily fixable.
You can add after this line
https://github.com/kangax/fabric.js/blob/master/src/shapes/itext.class.js#L329
this.transformMatrix && ctx.transform.apply(ctx, this.transformMatrix);
or after line 330.

I prefer to work on the proper fix, but if you need for some particular reason to have it working immediately this could be a solution.

@kangax kangax added the bug label May 6, 2015
@kangax kangax added this to the 1.5.1 milestone May 6, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants