|
|
|
@ -7,7 +7,6 @@ import { IReduxState, IStore } from '../../../../app/types'; |
|
|
|
|
import { ASPECT_RATIO_WIDE } from '../../../responsive-ui/constants'; |
|
|
|
|
import { storeVideoTransform } from '../../actions'; |
|
|
|
|
|
|
|
|
|
// @ts-ignore
|
|
|
|
|
import styles from './styles'; |
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -125,12 +124,12 @@ class VideoTransform extends Component<IProps, IState> { |
|
|
|
|
/** |
|
|
|
|
* The gesture handler object. |
|
|
|
|
*/ |
|
|
|
|
gestureHandlers: Object; |
|
|
|
|
gestureHandlers: any; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* The initial distance of the fingers on pinch start. |
|
|
|
|
*/ |
|
|
|
|
initialDistance: number; |
|
|
|
|
initialDistance?: number; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* The initial position of the finger on touch start. |
|
|
|
@ -234,8 +233,6 @@ class VideoTransform extends Component<IProps, IState> { |
|
|
|
|
videoTransformedViewContainerStyles, |
|
|
|
|
style |
|
|
|
|
] } |
|
|
|
|
|
|
|
|
|
// @ts-ignore
|
|
|
|
|
{ ...this.gestureHandlers.panHandlers }> |
|
|
|
|
<SafeAreaView |
|
|
|
|
edges = { [ 'bottom', 'left' ] } |
|
|
|
@ -489,7 +486,7 @@ class VideoTransform extends Component<IProps, IState> { |
|
|
|
|
* @param {?Object | number} value - The value of the gesture, if any. |
|
|
|
|
* @returns {void} |
|
|
|
|
*/ |
|
|
|
|
_onGesture(type: string, value: any) { |
|
|
|
|
_onGesture(type: string, value?: any) { |
|
|
|
|
let transform; |
|
|
|
|
|
|
|
|
|
switch (type) { |
|
|
|
@ -600,7 +597,7 @@ class VideoTransform extends Component<IProps, IState> { |
|
|
|
|
this._onGesture('scale', scale); |
|
|
|
|
} |
|
|
|
|
} else if (gestureState.numberActiveTouches === 1 |
|
|
|
|
&& isNaN(this.initialDistance) |
|
|
|
|
&& isNaN(this.initialDistance ?? 0) |
|
|
|
|
&& this._didMove(gestureState)) { |
|
|
|
|
// this is a move event
|
|
|
|
|
const position = this._getTouchPosition(evt); |
|
|
|
@ -623,11 +620,9 @@ class VideoTransform extends Component<IProps, IState> { |
|
|
|
|
*/ |
|
|
|
|
_onPanResponderRelease() { |
|
|
|
|
if (this.lastTap && Date.now() - this.lastTap < TAP_TIMEOUT_MS) { |
|
|
|
|
// @ts-ignore
|
|
|
|
|
this._onGesture('press'); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// @ts-ignore
|
|
|
|
|
delete this.initialDistance; |
|
|
|
|
this.initialPosition = { |
|
|
|
|
x: 0, |
|
|
|
|