From fd74c54ab8b666d39bed10654b6fcf99963974ba Mon Sep 17 00:00:00 2001 From: Sergey Mostsevenko Date: Sat, 20 Jun 2020 14:42:33 +1000 Subject: [PATCH] Limit the maximum Lottie pixel density --- src/components/ui/tgs/lottie.browser.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/components/ui/tgs/lottie.browser.ts b/src/components/ui/tgs/lottie.browser.ts index 91a2a372..06709274 100644 --- a/src/components/ui/tgs/lottie.browser.ts +++ b/src/components/ui/tgs/lottie.browser.ts @@ -47,8 +47,9 @@ export class TGSManager { this.state = props; this.element = createElement(); - this.element.width = props.width * window.devicePixelRatio; - this.element.height = props.height * window.devicePixelRatio; + const pixelDensity = Math.min(2, window.devicePixelRatio); + this.element.width = props.width * pixelDensity; + this.element.height = props.height * pixelDensity; } load() {