iced
iced copied to clipboard
Implement content_fit for viewer widget
Implemented content_fit
property for viewer
widget to have the same behavior, image
widget has. That required rework of image_size
function and minor rework of draw
and layout
functions.
Below are examples of how it's working.
On the left side is viewer
widget, on the right side is image
widget.
Contain
https://github.com/iced-rs/iced/assets/24297712/c270729a-eb69-437c-beab-3c82dae6aee8
Cover
https://github.com/iced-rs/iced/assets/24297712/c15a945e-a5ed-47d4-b7b1-6ca63950a7a5
Fill
https://github.com/iced-rs/iced/assets/24297712/15f6daac-39b5-45af-bdc9-cd7db0f5f897
None
https://github.com/iced-rs/iced/assets/24297712/7bd36807-ad92-4481-80e5-ef03652374eb
ScaleDown
https://github.com/iced-rs/iced/assets/24297712/5808d467-fa58-46f3-bf3c-e51cf8d9eba1
Resolved merge conflict, sorry!