Skip to content

Commit

Permalink
change camera updates to alias setCamera
Browse files Browse the repository at this point in the history
  • Loading branch information
matthew44-mappable committed Mar 11, 2024
1 parent 2c8fd27 commit 8f0d0a6
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions src/controls/MMapRotateControl/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ export class InternalRotateControl extends mappable.MMapComplexEntity<MMapRotate
}
const {duration, easing} = this._props;
let targetAzimuth = toggleRotate(this.root.azimuth);
this.root.update({camera: {azimuth: targetAzimuth, duration, easing}});
this.root.setCamera({azimuth: targetAzimuth, duration, easing});
};

private _onRotateStart = (event: MouseEvent) => {
Expand Down Expand Up @@ -136,7 +136,7 @@ export class InternalRotateControl extends mappable.MMapComplexEntity<MMapRotate
y: event.pageY
});
this._isClick = false;
this.root?.update({camera: {azimuth: this._startAzimuth + deltaAzimuth}});
this.root?.setCamera({azimuth: this._startAzimuth + deltaAzimuth});
};

private _onRotateEnd = () => {
Expand Down
4 changes: 2 additions & 2 deletions src/controls/MMapRotateTiltControl/MMapRotateControl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export class MMapRotateControl extends mappable.MMapGroupEntity<MMapRotateTiltCo
}
const {duration, easing} = this._props;
let targetAzimuth = toggleRotate(this.root.azimuth);
this.root.update({camera: {azimuth: targetAzimuth, duration, easing}});
this.root.setCamera({azimuth: targetAzimuth, duration, easing});
};

private _onRotateStart = (event: MouseEvent) => {
Expand Down Expand Up @@ -94,7 +94,7 @@ export class MMapRotateControl extends mappable.MMapGroupEntity<MMapRotateTiltCo
y: event.pageY
});
this._isClick = false;
this.root?.update({camera: {azimuth: this._startAzimuth + deltaAzimuth}});
this.root?.setCamera({azimuth: this._startAzimuth + deltaAzimuth});
};

private _onRotateEnd = () => {
Expand Down
4 changes: 2 additions & 2 deletions src/controls/MMapRotateTiltControl/MMapTiltControl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export class MMapTiltControl extends mappable.MMapComplexEntity<MMapRotateTiltCo
}
const {duration, easing} = this._props;
const targetTiltDeg = toggleTilt(radToDeg(this.root.tilt), MIN_TILT_DEG, MAX_TILT_DEG);
this.root.update({camera: {tilt: degToRad(targetTiltDeg), duration, easing}});
this.root.setCamera({tilt: degToRad(targetTiltDeg), duration, easing});
};

private _onTiltStart = (event: MouseEvent) => {
Expand Down Expand Up @@ -87,7 +87,7 @@ export class MMapTiltControl extends mappable.MMapComplexEntity<MMapRotateTiltCo
}
const deltaTilt = (Math.PI * delta) / this.root.size.y;
this._isClick = false;
this.root.update({camera: {tilt: this._startTilt + deltaTilt}});
this.root.setCamera({tilt: this._startTilt + deltaTilt});
};

private _onTiltEnd = () => {
Expand Down
4 changes: 2 additions & 2 deletions src/controls/MMapTiltControl/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ class InternalTiltControl extends mappable.MMapComplexEntity<MMapTiltControlProp
}
const {duration, easing} = this._props;
const targetTiltDeg = toggleTilt(radToDeg(this.root.tilt), MIN_TILT_DEG, MAX_TILT_DEG);
this.root.update({camera: {tilt: degToRad(targetTiltDeg), duration, easing}});
this.root.setCamera({tilt: degToRad(targetTiltDeg), duration, easing});
};

private _onTiltStart = (event: MouseEvent) => {
Expand Down Expand Up @@ -167,7 +167,7 @@ class InternalTiltControl extends mappable.MMapComplexEntity<MMapTiltControlProp
this._tiltIn?.classList.toggle(TILT_INDICATOR_ACTIVE_CLASS, tiltDiff > 0);
}

this.root.update({camera: {tilt: currentTilt}});
this.root.setCamera({tilt: currentTilt});
this._prevTilt = currentTilt;
};

Expand Down

0 comments on commit 8f0d0a6

Please sign in to comment.