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

i-text border selection when font weight changed for selected styles #2201

Closed
sarath-prohaktiv opened this issue May 16, 2015 · 3 comments · Fixed by #2204
Closed

i-text border selection when font weight changed for selected styles #2201

sarath-prohaktiv opened this issue May 16, 2015 · 3 comments · Fixed by #2204
Labels
Milestone

Comments

@sarath-prohaktiv
Copy link

This issue exist even in the kitchen sink demo. To replicate do the following steps
#1) Select some text [inside the i-text]
#2) Change font size large or small
#3) again select the i-text
#4) The border selection broken now.

Please see the screen shot
image

@asturur
Copy link
Member

asturur commented May 16, 2015

Do you use setSelectionStyle to change the style of the text?
Or you manually access the style property?

@sarath-prohaktiv
Copy link
Author

This example is from the fabric demo server.
You can reproduce this by calling setSelectionStyles with property fontSize

@asturur
Copy link
Member

asturur commented May 16, 2015

i see the error, i was asking if you found out in some other way.
Found the problem:

      this._setTextStyles(ctx);

      if (this._shouldClearCache()) {
        this._initDimensions(ctx);
      }

Even if we clear cache manually, at next render cycle, _initDimensions is performed just if shouldClearCache() returns true.
We should have some boolean to enforce running _initDimensions OR we should check in shouldClearCache() the check over style ( performance hit on big text chunks with lot of style )

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