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

setSelectionStyles behaviour not same on all characters selected #2740

Closed
24ozcoffee opened this issue Jan 18, 2016 · 2 comments · Fixed by #2868
Closed

setSelectionStyles behaviour not same on all characters selected #2740

24ozcoffee opened this issue Jan 18, 2016 · 2 comments · Fixed by #2868
Labels

Comments

@24ozcoffee
Copy link

Once a text selection is made, I cannot change the font size for the entire itext object.

// clear canvas
canvas.clear();
var t = new fabric.IText("Hello world !", {
top: 100,
left: 100,
fontSize: 12,
});

canvas.add(t);
canvas.setActiveObject(t);
t.selectAll();
var style = { };
style['fontSize'] = 84;
style['textBaseline'] = 'bottom';
t.setSelectionStyles(style);
canvas.renderAll();
canvas.discardActiveObject();
canvas.setActiveObject(t);
t.setFontSize(48);
canvas.renderAll();

@asturur
Copy link
Member

asturur commented Jan 18, 2016

that is true, and you can found an another issue. A style object cleaning is necessary. i mark it as a bug till i found the other issue.

@asturur asturur added the bug label Jan 18, 2016
@asturur asturur added text and removed bug labels Mar 26, 2016
@asturur
Copy link
Member

asturur commented Mar 26, 2016

I was wrong as labelling as a bug.
You are setting the font Size for all selection, so this is gonna stay untill you remove it.

There is a little bug anyway in setSelectionStyle that is adding too much properties to the latest style object in the selection.

I will investigate.

@asturur asturur changed the title Cannot "unselect" selected text font size setSelectionStyles behaviour not same on all characters selected Mar 26, 2016
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.

2 participants