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

Some fixes to textbox #2347

Merged
merged 1 commit into from
Jul 20, 2015
Merged

Some fixes to textbox #2347

merged 1 commit into from
Jul 20, 2015

Conversation

asturur
Copy link
Member

@asturur asturur commented Jul 17, 2015

Requires to update stylemap from splitTextLines to work with latestchanges of Itext Style.

Fill the cache array of this.__lineWidths that some functions expect to have.

closes #2339
canvas:
image

svg:
image

@asturur
Copy link
Member Author

asturur commented Jul 17, 2015

@jafferhaider @inssein have a look please

@inssein
Copy link
Contributor

inssein commented Jul 18, 2015

Looks good to me, thanks for catching and fixing that @asturur. I had to do the same for some of the functions in the mixins (https://github.com/kangax/fabric.js/blob/master/src/mixins/textbox_behavior.mixin.js#L68).

kangax added a commit that referenced this pull request Jul 20, 2015
@kangax kangax merged commit aba1b0e into fabricjs:master Jul 20, 2015
},

/**
* Calculate a styleMap that lets us know where styles as, as _textLines is separated by \n and wraps,
* but the style object line indices is by \n.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@asturur could you please rephrase this? it's difficult to understand it as it is

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generate an object that translates the style object so that it is broken up by visual lines (new lines and automatic wrapping). The original text styles object is broken up by actual lines (new lines only), which is only sufficient for Text / IText.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, changed

@asturur asturur deleted the fixes-textbox branch July 20, 2015 22:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

toSVG fails in presence of Textbox
3 participants