Skip to content

Commit

Permalink
Merge pull request #92 from paulmelnikow/zoom-in-state
Browse files Browse the repository at this point in the history
Add zoom state to toJSON() and fromJSON()
  • Loading branch information
yomotsu authored Apr 5, 2020
2 parents e6af917 + 1669a07 commit b5aa677
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/CameraControls.ts
Original file line number Diff line number Diff line change
Expand Up @@ -835,7 +835,7 @@ export class CameraControls extends EventDispatcher {
bb.min.y -= paddingBottom;
bb.max.x += paddingRight;
bb.max.y += paddingTop;

const bbSize = bb.getSize( _v3B );
const distance = this.getDistanceToFit( bbSize.x, bbSize.y, bbSize.z );
const center = bb.getCenter( _v3B ).applyQuaternion( rotation );
Expand Down Expand Up @@ -1175,6 +1175,8 @@ export class CameraControls extends EventDispatcher {

target0 : this._target0.toArray(),
position0 : this._position0.toArray(),

zoom : this._camera.zoom,
} );

}
Expand Down Expand Up @@ -1212,6 +1214,8 @@ export class CameraControls extends EventDispatcher {

}

this._camera.zoom = obj.zoom;

this._needsUpdate = true;

}
Expand Down

0 comments on commit b5aa677

Please sign in to comment.