ImageProps.cpp 1.2 KB

123456789101112131415161718192021222324252627282930313233343536
  1. /*
  2. * Copyright (c) Facebook, Inc. and its affiliates.
  3. *
  4. * This source code is licensed under the MIT license found in the
  5. * LICENSE file in the root directory of this source tree.
  6. */
  7. #include <react/components/image/ImageProps.h>
  8. #include <react/components/image/conversions.h>
  9. #include <react/core/propsConversions.h>
  10. namespace facebook {
  11. namespace react {
  12. ImageProps::ImageProps(const ImageProps &sourceProps, const RawProps &rawProps)
  13. : ViewProps(sourceProps, rawProps),
  14. sources(convertRawProp(rawProps, "source", sourceProps.sources, {})),
  15. defaultSources(convertRawProp(
  16. rawProps,
  17. "defaultSource",
  18. sourceProps.defaultSources,
  19. {})),
  20. resizeMode(convertRawProp(
  21. rawProps,
  22. "resizeMode",
  23. sourceProps.resizeMode,
  24. ImageResizeMode::Stretch)),
  25. blurRadius(
  26. convertRawProp(rawProps, "blurRadius", sourceProps.blurRadius, {})),
  27. capInsets(
  28. convertRawProp(rawProps, "capInsets", sourceProps.capInsets, {})),
  29. tintColor(
  30. convertRawProp(rawProps, "tintColor", sourceProps.tintColor, {})) {}
  31. } // namespace react
  32. } // namespace facebook