@@ -38,8 +38,14 @@ function getCompression(imageId) {
38
38
class ViewportOverlay extends PureComponent {
39
39
static propTypes = {
40
40
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
+ ] ) ,
43
49
imageId : PropTypes . string . isRequired ,
44
50
imageIndex : PropTypes . number . isRequired ,
45
51
stackSize : PropTypes . number . isRequired ,
@@ -77,7 +83,9 @@ class ViewportOverlay extends PureComponent {
77
83
78
84
const frameRate = formatNumberPrecision ( 1000 / frameTime , 1 ) ;
79
85
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 } `;
81
89
const imageDimensions = `${ columns } x ${ rows } ` ;
82
90
83
91
const { imageIndex, stackSize } = this . props ;
0 commit comments