From e0df54248eaa6f10a8877eef82db664f0824fecb Mon Sep 17 00:00:00 2001 From: cha0s Date: Sun, 1 May 2022 10:17:05 -0500 Subject: [PATCH] feat: initialFollow --- packages/topdown/src/traits/followed.js | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/packages/topdown/src/traits/followed.js b/packages/topdown/src/traits/followed.js index 5fc6954..c27324d 100644 --- a/packages/topdown/src/traits/followed.js +++ b/packages/topdown/src/traits/followed.js @@ -28,6 +28,11 @@ export default (flecks) => class Followed extends Trait { }; } + initialFollow() { + this.updatePosition(); + this.onRoomSizeChanged(); + } + listeners() { return { @@ -45,8 +50,17 @@ export default (flecks) => class Followed extends Trait { this.$$camera = json.camera; } this.$$camera.viewSize = this.params.viewSize; - this.updatePosition(); - this.onRoomSizeChanged(); + this.initialFollow(); + } + + methods() { + return { + + initialFollow: () => { + this.initialFollow(); + }, + + }; } onRoomSizeChanged() {