Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Add storeAsInitialCamera parameter to StackViewport setCamera #228

Merged
merged 1 commit into from
Oct 5, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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