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

Change of Image sizing unit and size validation fixes #29

Merged
merged 7 commits into from Apr 24, 2022
Merged

Conversation

AnonymouX47
Copy link
Owner

@AnonymouX47 AnonymouX47 commented Apr 23, 2022

Resolves #16

  • Changes image sizing unit to columns and lines.
  • Further fixes size validation (complements Image size setting, size validation and drawing/display. #12).
    • InvalidSize is no longer raised when vertical allowance is greater than the terminal size even though scroll is set to True.
    • The scroll parameter of TermImage.draw() now nullifies vertical allowance during image size validation.
  • Changes some terminologies:
    • "render size" -> "image size"
    • "render scale" -> "scale"

- Add: Added new "private" methods to `TermImage`.
  - `_get_render_size()`
  - `_pixels_cols()`
  - `_pixels_lines()`
  - `_width_height_px()`
- Change: Rewrote `TermImage._valid_size()`.
- Change: Modified `TermImage._render_image()`.
  - No more odd heights and half last lines, the last line is now always full.
- Change: Modified `rendered_*` properties.
- Change: Removed `TermImage._width_compensation`.
- Change: Updated comments and doctrings of modified methods and properties.
- Change: Updated docstrings of sizing-related methods and properties.
- Change: Updated sizing-related terminologies.
  - "render size" -> "image size".
  - "render scale" -> "scale".
- Fix: Removed small-size validation upon setting.
  - No more checking if is sizes are too small when setting.
- Fix: The *scroll* argument of `TermImage._renderer()` (and in turn, `TermImage.draw()`), when `True`, now nullifies vertical allowance during size validation.

Complements #12.
@AnonymouX47 AnonymouX47 added documentation Improvements or additions to documentation enhancement New feature / Improvement suggestion or request lib Related to the library (Not to be used anymore) labels Apr 23, 2022
@AnonymouX47 AnonymouX47 added this to the 0.3.0 milestone Apr 23, 2022
@AnonymouX47 AnonymouX47 linked an issue Apr 23, 2022 that may be closed by this pull request
3 tasks
@AnonymouX47 AnonymouX47 removed a link to an issue Apr 23, 2022
3 tasks
@AnonymouX47 AnonymouX47 changed the title Change of Image sizing unit Change of Image sizing unit and size validation fixes Apr 24, 2022
@AnonymouX47 AnonymouX47 merged commit a00651b into main Apr 24, 2022
@AnonymouX47 AnonymouX47 deleted the sizing-unit branch April 26, 2022 00:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature / Improvement suggestion or request lib Related to the library (Not to be used anymore)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Change of image sizing unit
1 participant