Closed HugoGresse closed 1 year ago
I've found the first issue (offset on translateX) caused by the containerDimensions.x being rounded (338 instead of 338.825), linked to my code
The second issue is weirder though I'm not sure what's causing this exactly:
It seems that the layout.x.value
is NaN when panGesture start. which result in getEdgeX
returning a NaN and image then disappear. The thing is that the image did appear, so the layout has the correct dimension set.
A quick fix is to check for NaN:
const getEdgeX = () => {
'worklet';
const newWidth = scale.value * layout.x.value;
const point = (newWidth - width) / 2;
if (point < 0 || isNaN(newWidth)) {
return [-0, 0];
}
return [-point, point];
};
@pavelbabenko let me know if you think it is a good idea so I can submit a PR.
Released in v0.3.6
Thanks for taking care of this. I would have liked to have been included in the mention, as right now, my contribution is disregarded in the final work.
Hi there,
I have the strangest issue to open, first time for me.
On a single iOS device, when opening the gallery, we have a bigger and bigger left margin (or translationY) as we open the gallery to an initialIndex higher and higher:
Opening index 100, the image displayed is the one before the current image.
React Native 0.70.6 Awesome gallery 0.3.5 OS: iOS only (no issue on android) Device model: iPhone 8 plus, iOS 16.3.1,
The weirdest thing is that on another identicial phone model, identical app version and clean install, we don't have the issue at all. So I'm fishing here as I didn't see a similar issue on this repo before, without a reproduction, to check wheter if you may have an idea about the issue.
Take care,