@@ -38,8 +38,14 @@ function getCompression(imageId) {
3838class ViewportOverlay extends PureComponent {
3939 static propTypes = {
4040 scale : PropTypes . number . isRequired ,
41- windowWidth : PropTypes . number . isRequired ,
42- windowCenter : PropTypes . number . isRequired ,
41+ windowWidth : PropTypes . oneOfType ( [
42+ PropTypes . number . isRequired ,
43+ PropTypes . string . isRequired ,
44+ ] ) ,
45+ windowCenter : PropTypes . oneOfType ( [
46+ PropTypes . number . isRequired ,
47+ PropTypes . string . isRequired ,
48+ ] ) ,
4349 imageId : PropTypes . string . isRequired ,
4450 imageIndex : PropTypes . number . isRequired ,
4551 stackSize : PropTypes . number . isRequired ,
@@ -77,7 +83,9 @@ class ViewportOverlay extends PureComponent {
7783
7884 const frameRate = formatNumberPrecision ( 1000 / frameTime , 1 ) ;
7985 const compression = getCompression ( imageId ) ;
80- const wwwc = `W: ${ windowWidth . toFixed ( 0 ) } L: ${ windowCenter . toFixed ( 0 ) } ` ;
86+ const wwwc = `W: ${
87+ windowWidth . toFixed ? windowWidth . toFixed ( 0 ) : windowWidth
88+ } L: ${ windowWidth . toFixed ? windowCenter . toFixed ( 0 ) : windowCenter } `;
8189 const imageDimensions = `${ columns } x ${ rows } ` ;
8290
8391 const { imageIndex, stackSize } = this . props ;
0 commit comments