Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
call add_transform directly instead of wrapping it into prepare_outro

Co-Authored-By: Rich Harris <[email protected]>
  • Loading branch information
Harald-1 and Rich-Harris authored Jun 3, 2019
1 parent 068a4b7 commit ef74838
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/compiler/compile/render-dom/wrappers/Element/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) : '{}';
Expand Down
2 changes: 1 addition & 1 deletion src/runtime/internal/animations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit ef74838

Please sign in to comment.