-
-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
Textbox: word widths not calculated using correct styles after line wrapping #3496
Comments
i guess we fixed this somehow. |
Yeah - doing a bit more debugging the lineIndex definitely seems off. i.e. |
if instead of spaces you add some letter, does it behaves correctly? |
I am not sure if this is related, but i also have an issue concerning textbox width and height calculation when using custom fonts. I made a fiddle based on the one provided by mlev: |
http://jsfiddle.net/8bmhnLzx/1/ us webfont loader with the active event to get font loaded immediately. |
@asturur OK - so getting my head around this a bit more - I hadn’t noticed the TextBox vs IText methods. What I’m seeing now is:
So looks like the styleMap lookup isn't working quite right. |
Narrowed it down to the call to I've added a local fix in our code to patch the
|
+1 |
looks like good to me. |
Version
1.7.1
Test Case
http://jsfiddle.net/mlev/j48qerLz/3/
Steps to reproduce
Expected Behavior
The dynamicMinWidth should not change as the longest word hasn't changed.
Actual Behavior
The dynamicMinWidth reduces to the unstyled width of the longest word.
From what I can see - after the line wrapping occurs the style lookup fails to find the correct styles for the bold text. The style lookup in
_getStyleDeclaration(lineIndex, charIndex)
is done by line and char indexes - so I'm guessing this styles data does not match the line numbers of the wrapped text.The text was updated successfully, but these errors were encountered: