|
@@ -270,7 +270,7 @@ export default class PhotoView extends React.Component<
|
|
handleUp = (newPageX: number, newPageY: number) => {
|
|
handleUp = (newPageX: number, newPageY: number) => {
|
|
if (this.state.touched) {
|
|
if (this.state.touched) {
|
|
const { onReachUp } = this.props;
|
|
const { onReachUp } = this.props;
|
|
- const { width, height } = this.photoRef.state;
|
|
|
|
|
|
+ const { width, naturalWidth, height } = this.photoRef.state;
|
|
this.setState(({
|
|
this.setState(({
|
|
x,
|
|
x,
|
|
y,
|
|
y,
|
|
@@ -289,7 +289,7 @@ export default class PhotoView extends React.Component<
|
|
const toScale = Math.max(
|
|
const toScale = Math.max(
|
|
Math.min(
|
|
Math.min(
|
|
scale,
|
|
scale,
|
|
- maxScale,
|
|
|
|
|
|
+ Math.max(maxScale, naturalWidth / width),
|
|
),
|
|
),
|
|
minScale,
|
|
minScale,
|
|
);
|
|
);
|