Skip to content

Commit

Permalink
fix: Add storeAsInitialCamera parameter to StackViewport.setCamera (#228
Browse files Browse the repository at this point in the history
)
  • Loading branch information
volrath authored Oct 5, 2022
1 parent 46c5377 commit b951acc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion common/reviews/api/core.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -1764,7 +1764,7 @@ export class StackViewport extends Viewport implements IStackViewport {
// (undocumented)
setActors(actors: Array<ActorEntry>): void;
// (undocumented)
setCamera(cameraInterface: ICamera): void;
setCamera(cameraInterface: ICamera, storeAsInitialCamera?: boolean): void;
// (undocumented)
setColormap(colormap: CPUFallbackColormapData): void;
// (undocumented)
Expand Down
7 changes: 5 additions & 2 deletions packages/core/src/RenderingEngine/StackViewport.ts
Original file line number Diff line number Diff line change
Expand Up @@ -620,11 +620,14 @@ class StackViewport extends Viewport implements IStackViewport {
* @param cameraInterface - The camera interface that will be used to
* render the scene.
*/
public setCamera(cameraInterface: ICamera): void {
public setCamera(
cameraInterface: ICamera,
storeAsInitialCamera = false
): void {
if (this.useCPURendering) {
this.setCameraCPU(cameraInterface);
} else {
super.setCamera(cameraInterface);
super.setCamera(cameraInterface, storeAsInitialCamera);
}
}

Expand Down

0 comments on commit b951acc

Please sign in to comment.