slot 0.0.1
A real time UI render framework
载入中...
搜索中...
未找到
CachedMeasurement.h
浏览该文件的文档.
1/*
2 * Copyright (c) Meta Platforms, Inc. and 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
8#pragma once
9
10#include <cmath>
11
12#include <yoga/Yoga.h>
13
16
17namespace facebook::yoga {
18
20 float availableWidth{-1};
21 float availableHeight{-1};
24
25 float computedWidth{-1};
26 float computedHeight{-1};
27
28 bool operator==(CachedMeasurement measurement) const {
29 bool isEqual = widthSizingMode == measurement.widthSizingMode &&
31
33 !yoga::isUndefined(measurement.availableWidth)) {
34 isEqual = isEqual && availableWidth == measurement.availableWidth;
35 }
37 !yoga::isUndefined(measurement.availableHeight)) {
38 isEqual = isEqual && availableHeight == measurement.availableHeight;
39 }
41 !yoga::isUndefined(measurement.computedWidth)) {
42 isEqual = isEqual && computedWidth == measurement.computedWidth;
43 }
45 !yoga::isUndefined(measurement.computedHeight)) {
46 isEqual = isEqual && computedHeight == measurement.computedHeight;
47 }
48
49 return isEqual;
50 }
51};
52
53} // namespace facebook::yoga
Definition Benchmark.cpp:19
static bool isUndefined(json &j)
Definition TreeDeserialization.cpp:24
SizingMode
Definition SizingMode.h:21
Definition CachedMeasurement.h:19
bool operator==(CachedMeasurement measurement) const
Definition CachedMeasurement.h:28
float computedHeight
Definition CachedMeasurement.h:26
float availableWidth
Definition CachedMeasurement.h:20
float computedWidth
Definition CachedMeasurement.h:25
float availableHeight
Definition CachedMeasurement.h:21
SizingMode heightSizingMode
Definition CachedMeasurement.h:23
SizingMode widthSizingMode
Definition CachedMeasurement.h:22