From ef74838e1e68fce489f6a7cab8526dee38b253c5 Mon Sep 17 00:00:00 2001 From: Harald-1 <51047840+Harald-1@users.noreply.github.com> Date: Mon, 3 Jun 2019 21:42:30 +0200 Subject: [PATCH] Apply suggestions from code review call add_transform directly instead of wrapping it into prepare_outro Co-Authored-By: Rich Harris --- src/compiler/compile/render-dom/wrappers/Element/index.ts | 2 +- src/runtime/internal/animations.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/compiler/compile/render-dom/wrappers/Element/index.ts b/src/compiler/compile/render-dom/wrappers/Element/index.ts index 712fab3eca..65d008278f 100644 --- a/src/compiler/compile/render-dom/wrappers/Element/index.ts +++ b/src/compiler/compile/render-dom/wrappers/Element/index.ts @@ -778,7 +778,7 @@ export default class ElementWrapper extends Wrapper { block.builders.fix.add_block(deindent` @fix_position(${this.var}); ${stop_animation}(); - ${outro && `@prepare_outro(${this.var}, ${rect});`} + ${outro && `@add_transform(${this.var}, ${rect});`} `); const params = this.node.animation.expression ? this.node.animation.expression.render(block) : '{}'; diff --git a/src/runtime/internal/animations.ts b/src/runtime/internal/animations.ts index b1b4a0cf8a..6a7f9e7828 100644 --- a/src/runtime/internal/animations.ts +++ b/src/runtime/internal/animations.ts @@ -94,7 +94,7 @@ export function fix_position(node: Element & ElementCSSInlineStyle) { } } -function add_transform(node: Element & ElementCSSInlineStyle, a: PositionRect) { +export function add_transform(node: Element & ElementCSSInlineStyle, a: PositionRect) { const b = node.getBoundingClientRect(); if (a.left !== b.left || a.top !== b.top) {