Apply suggestions from code review

call add_transform directly instead of wrapping it into prepare_outro

Co-Authored-By: Rich Harris <richard.a.harris@gmail.com>
pull/7738/head
Harald-1 6 years ago committed by GitHub
parent 35cdaa821e
commit eb6a3c5b71

@ -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) : '{}';

@ -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) {

Loading…
Cancel
Save