Преглед на файлове

update setState of unit repr

Sebastian Bittrich преди 1 година
родител
ревизия
6276365766
променени са 1 файла, в които са добавени 5 реда и са изтрити 5 реда
  1. 5 5
      src/mol-repr/structure/units-representation.ts

+ 5 - 5
src/mol-repr/structure/units-representation.ts

@@ -258,9 +258,9 @@ export function UnitsRepresentation<P extends StructureParams>(label: string, ct
         const { visible, alphaFactor, pickable, overpaint, transparency, substance, clipping, themeStrength, transform, unitTransforms, syncManually, markerActions } = state;
         const newState: Partial<StructureRepresentationState> = {};
 
-        if (visible !== _state.visible) newState.visible = visible;
-        if (alphaFactor !== _state.alphaFactor) newState.alphaFactor = alphaFactor;
-        if (pickable !== _state.pickable) newState.pickable = pickable;
+        if (visible !== undefined) newState.visible = visible;
+        if (alphaFactor !== undefined) newState.alphaFactor = alphaFactor;
+        if (pickable !== undefined) newState.pickable = pickable;
         if (overpaint !== undefined && _structure) {
             newState.overpaint = Overpaint.remap(overpaint, _structure);
         }
@@ -281,8 +281,8 @@ export function UnitsRepresentation<P extends StructureParams>(label: string, ct
             newState.unitTransforms = unitTransforms;
             _state.unitTransformsVersion = unitTransforms ? unitTransforms?.version : -1;
         }
-        if (syncManually !== _state.syncManually) newState.syncManually = syncManually;
-        if (markerActions !== _state.markerActions) newState.markerActions = markerActions;
+        if (syncManually !== undefined) newState.syncManually = syncManually;
+        if (markerActions !== undefined) newState.markerActions = markerActions;
 
         visuals.forEach(({ visual, group }) => setVisualState(visual, group, newState));