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/2910/head
Harald-1 5 years ago committed by GitHub
parent 068a4b7312
commit ef74838e1e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -778,7 +778,7 @@ export default class ElementWrapper extends Wrapper {
block.builders.fix.add_block(deindent` block.builders.fix.add_block(deindent`
@fix_position(${this.var}); @fix_position(${this.var});
${stop_animation}(); ${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) : '{}'; 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(); const b = node.getBoundingClientRect();
if (a.left !== b.left || a.top !== b.top) { if (a.left !== b.left || a.top !== b.top) {

Loading…
Cancel
Save