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

Wrong cols calculation when terminal change size with css variable #602

Closed
jcubic opened this issue Jul 14, 2020 · 1 comment
Closed

Wrong cols calculation when terminal change size with css variable #602

jcubic opened this issue Jul 14, 2020 · 1 comment
Labels
Bug resolved if issue is resolved, it will be open until merge with master

Comments

@jcubic
Copy link
Owner

jcubic commented Jul 14, 2020

Issue summary

when tere is --size variable on terminal the calculation of cols is wrong (probably size of the character in calculation is wrong)

Expected behavior

I expect figlet.js to resize properly when using --size: 1.1 in demo

Actual behavior

the text is cut off because term.cols() is too big.

Steps to reproduce

  1. Open Figlet + resize demo https://codepen.io/jcubic/pen/jOWvENE
  2. Add --size: 1.1 to body .shell .terminal selector
  3. Type: "hello world as we know it" and resize the terminal

Browser and OS

@jcubic jcubic added the Bug label Jul 14, 2020
jcubic added a commit that referenced this issue Jul 15, 2020
The problem was that the terminal on init calculate size but it use fake terminal added to body
because of this it didn't pick up --size from different selectors like '.foo .terminal'
@jcubic
Copy link
Owner Author

jcubic commented Jul 15, 2020

The problem was that --size was added to selector other then bare .terminal, :root or body. When terminal is initialized it use fake terminal to get the size of the character that was wrong because the fake terminal use .terminal added to body.

@jcubic jcubic added the resolved if issue is resolved, it will be open until merge with master label Jul 15, 2020
@jcubic jcubic closed this as completed Aug 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug resolved if issue is resolved, it will be open until merge with master
Projects
None yet
Development

No branches or pull requests

1 participant