Skip to content

Commit

Permalink
fix(render): Fix a re-render on opening/closing sidebars on change
Browse files Browse the repository at this point in the history
  • Loading branch information
wayfarer3130 committed Jul 15, 2023
1 parent 93a009f commit 805612f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
10 changes: 2 additions & 8 deletions extensions/cornerstone/src/Viewport/OHIFCornerstoneViewport.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,6 @@ const OHIFCornerstoneViewport = React.memo(props => {
const [{ isCineEnabled, cines }, cineService] = useCine();
const [{ activeViewportIndex }] = useViewportGrid();
const [enabledVPElement, setEnabledVPElement] = useState(null);

const elementRef = useRef();

const {
Expand Down Expand Up @@ -435,7 +434,6 @@ const OHIFCornerstoneViewport = React.memo(props => {
displaySetOptions,
presentations
);

if (measurement) {
cs3DTools.annotation.selection.setAnnotationSelected(measurement.uid);
}
Expand Down Expand Up @@ -488,11 +486,8 @@ const OHIFCornerstoneViewport = React.memo(props => {
<React.Fragment>
<div className="viewport-wrapper">
<ReactResizeDetector
handleWidth
handleHeight
skipOnMount={true} // Todo: make these configurable
refreshMode={'debounce'}
refreshRate={200} // transition amount in side panel
refreshMode="debounce"
refreshRate={50} // Wait 50 ms after last move to render
onResize={onResize}
targetRef={elementRef.current}
/>
Expand Down Expand Up @@ -659,7 +654,6 @@ function _jumpToMeasurement(
const viewportInfo = cornerstoneViewportService.getViewportInfoByIndex(
viewportIndex
);

if (enabledElement) {
// See how the jumpToSlice() of Cornerstone3D deals with imageIdx param.
const viewport = enabledElement.viewport as
Expand Down
1 change: 1 addition & 0 deletions platform/ui/src/components/Dialog/Footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ const Footer = ({ actions, className, onSubmit, value }) => {
return (
<Button
key={index}
name={action.text}
className={classNames({ 'ml-2': !isFirst }, action.classes)}
type={action.type}
onClick={onClickHandler}
Expand Down

0 comments on commit 805612f

Please sign in to comment.