-
-
Notifications
You must be signed in to change notification settings - Fork 833
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
Character cell sometimes padded with an additional pixel. #535
Comments
Derive the pixels from the rows/cols rather than the available space. refs: #535
Good catch! I think I found the spot and pushed a commit to make sure that we report pixel dimensions based on cell dimensions * font metrics. |
Confirmed, looks like the size is now stable. If your font size is also 10x22 (which is the default out of a fresh compile on my machine, but that might as well really depend on what fonts I have available on my system I suppose), then the video-snippet from #534 should also not scroll anymore. I think this can be closed. |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further. |
Describe the bug
(note, could not be a bug but working-as-intended but see below in Additional context why this can break things for a potential better way)
Reading the window size character cells and in pixels and pixels they consume can change when window size is changed.
Environment (please complete the following information):
20210203-095643-70a364eb-217-g9ddc2da6
To Reproduce
Read the window size:
Run this program, note the character cell size. Resize window and run again. In some settings the character cell size changes by a pixel. In the following example, between a resize, the size of a character cell changes from 10px x 22px to 10px x 23px.
Expected behavior
Expected would be that the cell-size (pixels / cell-count) is consistent and only a function of the font used, independent of the size of the window.
Additional context
This might be working-as-intended in an attempt to best use the space available in the window without creating an awkward border all around.
But I think it will create more trouble in situations where the assumption that a character fills the entire character cell will broken; because naturally the single pixel cell spacing now will have the background color.
So in all situations that uses graphical characters, such lines or blocks with use of foreground and background color will create different results depending on the size of the window and leave fine lines.
timg is an example. It has a workaround mode in which the user can choose if an upper or lower block should be used to mask the issue, but that only works for half-sized blocks.
Possible solution
So instead of adding inter-spacing between character cells, I suggest to just add the necessary padding just as a frame around the window. Even if it will mean that this is can be up to half a character cell of empty space around the window, it will leave a consistent character block experience.
The text was updated successfully, but these errors were encountered: