Skip to content

feat(mosaic): option to maintain aspect ratio of image#517

Open
gianluparri03 wants to merge 1 commit intocharmbracelet:mainfrom
gianluparri03:main
Open

feat(mosaic): option to maintain aspect ratio of image#517
gianluparri03 wants to merge 1 commit intocharmbracelet:mainfrom
gianluparri03:main

Conversation

@gianluparri03
Copy link
Copy Markdown

@gianluparri03 gianluparri03 commented Aug 3, 2025

Describe your changes

Created a mosaic.Fit value that lets you specify only one size of the image to be rendered, while the other one will be calculated in order to maintain the aspect ratio. For example:

mosaic.New().Width(100).Height(mosaic.Fit) // Fits to width
mosaic.New().Height(100).Width(mosaic.Fit) // Fits to height

Related issue/discussion: #475

Checklist before requesting a review

If this is a feature

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.

1 participant