From 1e90c401b0b562a3995606d915a72c6a48211ea1 Mon Sep 17 00:00:00 2001 From: infeng Date: Sat, 22 Oct 2016 14:07:16 +0800 Subject: [PATCH] fix --- src/ViewerCore.tsx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/ViewerCore.tsx b/src/ViewerCore.tsx index 79454ae..3d5b93b 100644 --- a/src/ViewerCore.tsx +++ b/src/ViewerCore.tsx @@ -89,7 +89,7 @@ export default class ViewerCore extends React.Component { this.bindEvent(); - this.loadImg(this.state.activeIndex, true); + this.loadImg(activeIndex, true); }, 300); }, 10); } componentDidMount() { - this.startVisible(); + this.startVisible(this.state.activeIndex); } getImgWidthHeight(imgWidth, imgHeight) { @@ -113,10 +113,10 @@ export default class ViewerCore extends React.Component 1) { - width = Math.min(this.containerWidth * .9, imgWidth); + width = Math.min(this.containerWidth * .8, imgWidth); height = (width / imgWidth) * imgHeight; }else { - height = Math.min((this.containerWidth - this.footerHeight) * .8, imgHeight); + height = Math.min((this.containerHeight - this.footerHeight) * .8, imgHeight); width = (height / imgHeight) * imgWidth; } return [width, height]; @@ -364,7 +364,7 @@ export default class ViewerCore extends React.Component