Skip to content

Commit

Permalink
fix: change structuredClone to the lib deep clone (#1529)
Browse files Browse the repository at this point in the history
* fix:change structuredClone to JSON way

* use the library deepClone instead of structuredClone

* remove dependency cycle

---------

Co-authored-by: Alireza <ar.sedghi@gmail.com>
  • Loading branch information
virtualman333 and sedghi authored Oct 31, 2024
1 parent b7246eb commit d45b9e7
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/core/src/RenderingEngine/Viewport.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ import type vtkActor from '@kitware/vtk.js/Rendering/Core/Actor';
import type vtkProp from '@kitware/vtk.js/Rendering/Core/Prop';
import type vtkImageData from '@kitware/vtk.js/Common/DataModel/ImageData';
import type vtkMapper from '@kitware/vtk.js/Rendering/Core/Mapper';
import { deepClone } from '../utilities/deepClone';

/**
* An object representing a single viewport, which is a camera
Expand Down Expand Up @@ -152,11 +153,12 @@ class Viewport {
this.renderingEngineId
);

this.defaultOptions = structuredClone(props.defaultOptions);
this.defaultOptions = deepClone(props.defaultOptions);
this.suppressEvents = props.defaultOptions.suppressEvents
? props.defaultOptions.suppressEvents
: false;
this.options = structuredClone(props.defaultOptions);
//this.options = structuredClone(props.defaultOptions);
this.options = deepClone(props.defaultOptions);
this.isDisabled = false;
}

Expand Down

0 comments on commit d45b9e7

Please sign in to comment.