Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/ImageView.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ const SCALE_MAXIMUM = 5;
const HEADER_HEIGHT = 60;
const SCALE_MAX_MULTIPLIER = 3;
const FREEZE_SCROLL_DISTANCE = 15;
const PRESS_TOLLERANCE = 5;
const BACKGROUND_OPACITY_MULTIPLIER = 0.003;
const defaultBackgroundColor = [0, 0, 0];

Expand Down Expand Up @@ -340,8 +341,8 @@ export default class ImageView extends Component<PropsType, StateType> {
const backgroundOpacity = Math.abs(
dy * BACKGROUND_OPACITY_MULTIPLIER
);

this.imageTranslateValue.y.setValue(y + dy);
const justPressed = Math.abs(dy) < PRESS_TOLLERANCE;
justPressed ? null : this.imageTranslateValue.y.setValue(y + dy)
this.modalBackgroundOpacity.setValue(
backgroundOpacity > 1 ? 1 : backgroundOpacity
);
Expand Down