From dc12a22780ee94e54c8a652c8c98592226a1a15e Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Thu, 15 Apr 2021 08:28:22 +0200 Subject: [PATCH] Add small comment to the image docs regarding image-fit and aspect ratio --- docs/builtin_elements.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/builtin_elements.md b/docs/builtin_elements.md index 9da15b3d5..0b963c1fe 100644 --- a/docs/builtin_elements.md +++ b/docs/builtin_elements.md @@ -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; } } ```