YGLayout.h 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. /**
  2. * Copyright (c) 2014-present, Facebook, Inc.
  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. #pragma once
  8. #include "YGFloatOptional.h"
  9. #include "Yoga-internal.h"
  10. struct YGLayout {
  11. std::array<float, 4> position;
  12. std::array<float, 2> dimensions;
  13. std::array<float, 6> margin;
  14. std::array<float, 6> border;
  15. std::array<float, 6> padding;
  16. YGDirection direction;
  17. uint32_t computedFlexBasisGeneration;
  18. YGFloatOptional computedFlexBasis;
  19. bool hadOverflow;
  20. // Instead of recomputing the entire layout every single time, we
  21. // cache some information to break early when nothing changed
  22. uint32_t generationCount;
  23. YGDirection lastOwnerDirection;
  24. uint32_t nextCachedMeasurementsIndex;
  25. std::array<YGCachedMeasurement, YG_MAX_CACHED_RESULT_COUNT>
  26. cachedMeasurements;
  27. std::array<float, 2> measuredDimensions;
  28. YGCachedMeasurement cachedLayout;
  29. bool didUseLegacyFlag;
  30. bool doesLegacyStretchFlagAffectsLayout;
  31. YGLayout();
  32. bool operator==(YGLayout layout) const;
  33. bool operator!=(YGLayout layout) const;
  34. };