Compare commits

...

1 Commits

Author SHA1 Message Date
vineyardbovines b0146a741d fix android carousel jiggle from cdn-rounded aspect ratio 2026-07-14 13:17:07 -04:00
+11 -3
View File
@@ -485,9 +485,17 @@ function GalleryImage({
loading={index === 0 ? 'eager' : 'lazy'}
style={[dims]}
onLoad={e => {
const ar = getAspectRatio(e.source)
if (ar && ar !== aspectRatio) {
setAspectRatio(ar)
/*
* Only sync from the loaded thumb if we don't already have a
* ratio from the record. The CDN scales thumbs to integer pixel
* dims, so its reported ratio drifts a fraction from the
* record's - re-syncing would jiggle the FlatList item widths.
*/
if (aspectRatio === undefined) {
const ar = getAspectRatio(e.source)
if (ar !== undefined) {
setAspectRatio(ar)
}
}
onThumbDims(index, {
width: e.source.width,