diff options
author | dan <dan.abramov@gmail.com> | 2023-10-05 23:52:04 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-10-05 15:52:04 -0700 |
commit | 4ec5fabdd1c1b70fd8a3f5671c056bba3d38e174 (patch) | |
tree | 5452b0ec1f56d3857009f1df99c7985cbd4295c8 /src/view/com/lightbox/ImageViewing/utils.ts | |
parent | 260b03a05c22232373cbf8cb0d7dda41a3302343 (diff) | |
download | voidsky-4ec5fabdd1c1b70fd8a3f5671c056bba3d38e174.tar.zst |
Fix animations and gestures getting reset on state updates in the lightbox (#1618)
* Fix translation resetting on state update * Copy getImageStyles into iOS and Android forks * Fix opacity resetting on state update
Diffstat (limited to 'src/view/com/lightbox/ImageViewing/utils.ts')
-rw-r--r-- | src/view/com/lightbox/ImageViewing/utils.ts | 24 |
1 files changed, 0 insertions, 24 deletions
diff --git a/src/view/com/lightbox/ImageViewing/utils.ts b/src/view/com/lightbox/ImageViewing/utils.ts index 03f28d61a..6fc411638 100644 --- a/src/view/com/lightbox/ImageViewing/utils.ts +++ b/src/view/com/lightbox/ImageViewing/utils.ts @@ -6,7 +6,6 @@ * */ -import {Animated} from 'react-native' import {Dimensions, Position} from './@types' export const getImageTransform = ( @@ -25,29 +24,6 @@ export const getImageTransform = ( return [{x, y}, scale] as const } -export const getImageStyles = ( - image: Dimensions | null, - translate: Animated.ValueXY, - scale?: Animated.Value, -) => { - if (!image?.width || !image?.height) { - return {width: 0, height: 0} - } - - const transform = translate.getTranslateTransform() - - if (scale) { - // @ts-ignore TODO - is scale incorrect? might need to remove -prf - transform.push({scale}, {perspective: new Animated.Value(1000)}) - } - - return { - width: image.width, - height: image.height, - transform, - } -} - export const getImageTranslate = ( image: Dimensions, screen: Dimensions, |