mirror of
https://github.com/slint-ui/slint.git
synced 2025-10-01 14:21:16 +00:00
Add small comment to the image docs regarding image-fit and aspect ratio
This commit is contained in:
parent
ed888664f9
commit
dc12a22780
1 changed files with 2 additions and 1 deletions
|
@ -138,6 +138,7 @@ Example := Window {
|
|||
VerticalLayout {
|
||||
Image {
|
||||
source: @image-url("https://sixtyfps.io/resources/logo_scaled.png");
|
||||
// image-fit default is `contain` when in layout, preserving aspect ratio
|
||||
}
|
||||
Image {
|
||||
source: @image-url("https://sixtyfps.io/resources/logo_scaled.png");
|
||||
|
@ -154,7 +155,7 @@ Example := Window {
|
|||
Image {
|
||||
source: @image-url("https://sixtyfps.io/resources/logo_scaled.png");
|
||||
width: 270px;
|
||||
// implicit default: height: self.width * natural_height / natural_width;
|
||||
// implicit default, preserving aspect ratio: height: self.width * natural_height / natural_width;
|
||||
}
|
||||
}
|
||||
```
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue