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

[canvas-] change mock window size from 80x25 to 1x1 #2171 #2485

Merged
merged 1 commit into from
Oct 6, 2024

Conversation

midichef
Copy link
Contributor

@midichef midichef commented Aug 5, 2024

Closes #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)
@anjakefala anjakefala merged commit 3bdda47 into saulpw:develop Oct 6, 2024
13 checks passed
@midichef midichef deleted the graph_window_init branch October 9, 2024 21:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[graph] terminals smaller than 80x25 attempt to draw offscreen
3 participants