Skip to content

Commit 9a88b5a

Browse files
authored
Merge pull request phaserjs#3354 from brandonvdongen/master
fixed camera offset when combining zoom+follow
2 parents eb43249 + 143d598 commit 9a88b5a

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/cameras/2d/Camera.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -852,8 +852,8 @@ var Camera = new Class({
852852
originX = follow.x;
853853
originY = follow.y;
854854

855-
this.scrollX = originX - width * 0.5;
856-
this.scrollY = originY - height * 0.5;
855+
this.scrollX = (originX - width * 0.5) / zoom;
856+
this.scrollY = (originY - height * 0.5) / zoom;
857857
}
858858

859859
if (this.useBounds)

0 commit comments

Comments
 (0)