Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[canvas-] change mock window size from 80x25 to 1x1 #2171
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)
- Loading branch information