From 29143ed04bd7117988c4fe98af1cf672a16e2265 Mon Sep 17 00:00:00 2001 From: Travis Fischer Date: Fri, 10 May 2019 08:36:34 -0400 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- readme.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/readme.md b/readme.md index bc52fc5..1d945a8 100644 --- a/readme.md +++ b/readme.md @@ -60,6 +60,14 @@ await renderLottie({ }) ``` +#### Output Scaling + +If you pass `width` or `height`, the other dimension will be inferred by maintaining the original animation's aspect ratio. + +If both `width` and `height` are passed, the output will have those dimensions, but there will be extra whitespace (or transparency if rendering PNGs) due to `lottie-web`'s default `rendererSettings.preserveAspectRatio` of `xMidyMid meet` ([docs](https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/preserveAspectRatio) and [demo](https://codepen.io/giodif/pen/VYpaeo)). + +For `mp4` outputs, the height may be different by a pixel due to the `x264` encoder requiring even heights. + ## API