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

bug: fix issues caused by having a width that is too small #665

Merged
merged 4 commits into from
Jan 28, 2022

Conversation

ClementTsang
Copy link
Owner

@ClementTsang ClementTsang commented Jan 27, 2022

Description

A description of the change and what it does. If relevant (such as any change that modifies the UI), please provide screenshots of the change:

Due to a missing check, you could resize the window to a width that was too small, and it would trigger an endless while-loop for any table while trying to redistribute remaining space. This has been rectified with an explicit check, as well as a smarter method of redistributing remaining space borrowed from the rewrite.

This also adds explicit width checks for widgets that have borders; if the width is <2, before, it would panic.

Note that the rewrite I have kinda fixes all these issues already, so I don't want to invest too hard into this, but this should be fine as a patch for now.

Also note that minimal heights don't seem to be causing any issues, it just seems to be minimal widths.

Issue

If applicable, what issue does this address?

Closes: #664

Testing

If relevant, please state how this was tested. All changes must be tested to work:

Please also indicate which platforms were tested. All platforms directly affected by the change must be tested:

  • Windows
  • macOS
  • Linux

Checklist

If relevant, ensure the following have been met:

  • Areas your change affects have been linted using rustfmt (cargo fmt)
  • The change has been tested and doesn't appear to cause any unintended breakage
  • Documentation has been added/updated if needed (README.md, help menu, etc.)
  • The pull request passes the provided CI pipeline
  • There are no merge conflicts

… small

Due to a missing check, you could resize the window to a width that was
too small, and it would trigger an endless while-loop for any table
while trying to redistribute remaining space. This has been
rectified with an explicit check, as well as a smarter method of
redistributing remaining space borrowed from the rewrite.

Note that minimal heights don't seem to be any issues.
@ClementTsang ClementTsang force-pushed the fix_too_small_width_resize branch from 19ccecf to 13b8c6c Compare January 27, 2022 21:51
@codecov-commenter
Copy link

codecov-commenter commented Jan 27, 2022

Codecov Report

Merging #665 (198b852) into master (fbd9512) will increase coverage by 0.64%.
The diff coverage is 44.44%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master    #665      +/-   ##
=========================================
+ Coverage    7.21%   7.85%   +0.64%     
=========================================
  Files          52      52              
  Lines        8238    8259      +21     
=========================================
+ Hits          594     649      +55     
+ Misses       7644    7610      -34     
Impacted Files Coverage Δ
src/canvas.rs 0.00% <0.00%> (ø)
src/canvas/drawing_utils.rs 57.29% <92.30%> (+57.29%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 255b69c...198b852. Read the comment docs.

@ClementTsang ClementTsang changed the title bug: fix endless loop when resizing the window to a width that is too small bug: fix issues caused by having a width that is too small Jan 27, 2022
@ClementTsang ClementTsang merged commit 6c98978 into master Jan 28, 2022
@ClementTsang ClementTsang deleted the fix_too_small_width_resize branch January 28, 2022 00:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Output becomes blank when resizing
2 participants