Skip to content

Commit

Permalink
fix: Fix event for camera modified firing with wrong values (#133)
Browse files Browse the repository at this point in the history
  • Loading branch information
swederik authored Jun 20, 2022
1 parent 6b7f1fd commit f16f994
Showing 1 changed file with 3 additions and 19 deletions.
22 changes: 3 additions & 19 deletions packages/core/src/RenderingEngine/StackViewport.ts
Original file line number Diff line number Diff line change
Expand Up @@ -708,14 +708,8 @@ class StackViewport extends Viewport implements IStackViewport {
const { viewport, image } = this._cpuFallbackEnabledElement;
const previousCamera = this.getCameraCPU();

const {
focalPoint,
viewUp,
parallelScale,
scale,
flipHorizontal,
flipVertical,
} = cameraInterface;
const { focalPoint, parallelScale, scale, flipHorizontal, flipVertical } =
cameraInterface;

const { clientHeight } = this.element;

Expand Down Expand Up @@ -778,19 +772,9 @@ class StackViewport extends Viewport implements IStackViewport {
this._cpuFallbackEnabledElement
);

const updatedCamera = {
...previousCamera,
focalPoint,
viewUp,
flipHorizontal,
flipVertical,
parallelScale: viewport.parallelScale,
scale: viewport.scale,
};

const eventDetail: EventTypes.CameraModifiedEventDetail = {
previousCamera,
camera: updatedCamera,
camera: this.getCamera(),
element: this.element,
viewportId: this.id,
renderingEngineId: this.renderingEngineId,
Expand Down

0 comments on commit f16f994

Please sign in to comment.