-
-
Notifications
You must be signed in to change notification settings - Fork 283
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
[graph] terminals smaller than 80x25 attempt to draw offscreen #2171
Comments
Thanks for looking into this, @midichef. It's probably entirely cosmetic but it would be good to clean it up anyway. |
Plotter/Canvas/GraphSheet do not have a screen when __init__() is called. Until they have a screen, DrawablePane.windowWidth and .windowHeight will give 25 and 80. If the actual terminal is smaller than 80x25. errors will be caused by drawing past the edges of the terminal. This commit uses a temporary size of 1x1 in __init__(). True canvas dimensions will be calculated later, with the real curses screen, by first calling Canvas.refresh(), then waiting for the next screen draw. During that draw, the sheet's screen will be provided by drawSheet(): drawSheet(scr, sheet) -> draw(scr) -> render(h, w) -> resetCanvasDimensions(w, h)
My best guess is that these commits did not cause the bug. They merely revealed it. The bug is sensitive to timing. While investigating, I accidentally made the problem disappear by adding I've got a patch for |
Plotter/Canvas/GraphSheet do not have a screen when __init__() is called. Until they have a screen, DrawablePane.windowWidth and .windowHeight will give 25 and 80. If the actual terminal is smaller than 80x25. errors will be caused by drawing past the edges of the terminal. This commit uses a temporary size of 1x1 in __init__(). True canvas dimensions will be calculated later, with the real curses screen, by first calling Canvas.refresh(), then waiting for the next screen draw. During that draw, the sheet's screen will be provided by drawSheet(): drawSheet(scr, sheet) -> draw(scr) -> render(h, w) -> resetCanvasDimensions(w, h)
[canvas-] change mock window size from 80x25 to 1x1 #2171
Small description
If a window is smaller than the default startup window,
canvas.py
thinks the screen is bigger than it is, and attempts to draw offscreen at first. This causes errors to show up from various calls toscr.addstr()
:Steps to reproduce with sample data and a .vd
Open a terminal narrower than 80 columns or shorter than 25 columns, and plot any data set.
Additional context
saul.pw/VisiData v3.0dev
I'm looking into the cause and a fix.
The text was updated successfully, but these errors were encountered: