-
-
Notifications
You must be signed in to change notification settings - Fork 832
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: simplify "Contain" and "Cover" formulas; use max for "Cover…
…", min for "Contain" This was derived from the principle of direct proportion `x=ky` where `k` is the scaling factor, and `x` `y` are the dimensions. Scaling factor is based on image's dimension relative to the window's. Contain needs the minimum scaling factor to ensure both dimensions fit within the window. Cover needs maximum scaling factor to ensure the image's smaller dimension fits in the window, allowing the larger dimension to crop, as expected.
- Loading branch information
Showing
1 changed file
with
15 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters