Skip to content
This repository was archived by the owner on Sep 28, 2021. It is now read-only.

Commit 6be276e

Browse files
authored
Merge pull request #338 from alexiri/scale
Expose minScale and maxScale
2 parents 55a460c + aa5e15f commit 6be276e

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

src/image-viewer.component.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -552,6 +552,8 @@ export default class ImageViewer extends React.Component<Props, State> {
552552
pinchToZoom={this.props.enableImageZoom && !this.state.isShowMenu}
553553
enableDoubleClickZoom={this.props.enableImageZoom && !this.state.isShowMenu}
554554
doubleClickInterval={this.props.doubleClickInterval}
555+
minScale={this.props.minScale}
556+
maxScale={this.props.maxScale}
555557
>
556558
{this!.props!.renderImage!(image.props)}
557559
</ImageZoom>

src/image-viewer.type.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,13 @@ export class Props {
8181

8282
public doubleClickInterval?: number;
8383

84+
/**
85+
* Min and Max scale for zooming
86+
*/
87+
public minScale?: number;
88+
89+
public maxScale?: number;
90+
8491
/**
8592
* 是否预加载图片
8693
*/

0 commit comments

Comments
 (0)