/
githubmr
/
facebook-react-native
Обзор
Документация
Войти
/
githubmr
/
facebook-react-native
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
main
packages/react-native/Libraries/Image/ImageUtils.js
25 строк
595 B
Mateo Guzmán
feat(image): support for `resizeMode` and `objectFit` value of `'none'` (#47110)
05 ноя 2024, 22:36
05 ноя 2024, 22:36
d8cfd98
Код
Авторство
О чём код?
/** * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * * @flow strict * @format */ import type {ImageResizeMode} from './ImageResizeMode'; const objectFitMap: {[string]: ImageResizeMode} = { contain: 'contain', cover: 'cover', fill: 'stretch', 'scale-down': 'contain', none: 'none', }; export function convertObjectFitToResizeMode( objectFit: ?string, ): ?ImageResizeMode { return objectFit != null ? objectFitMap[objectFit] : undefined; }