About
Contact
QtCreator
KDevelop
Solarized
1
// Copyright (C) 2016 The Qt Company Ltd.
2
// Copyright (c) Meta Platforms, Inc. and affiliates.
3
//
4
// SPDX-License-Identifier: MIT
5
6
#include
"YGLayout.h"
7
#include
"Utils.h"
8
9
using
namespace
facebook
;
10
11
bool
YGLayout
::
operator
==
(
YGLayout
layout
)
const
{
12
bool
isEqual
=
YGFloatArrayEqual
(
val1:
position
,
val2:
layout
.
position
) &&
13
YGFloatArrayEqual
(
val1:
dimensions
,
val2:
layout
.
dimensions
) &&
14
YGFloatArrayEqual
(
val1:
margin
,
val2:
layout
.
margin
) &&
15
YGFloatArrayEqual
(
val1:
border
,
val2:
layout
.
border
) &&
16
YGFloatArrayEqual
(
val1:
padding
,
val2:
layout
.
padding
) &&
17
direction
() ==
layout
.
direction
() &&
18
hadOverflow
() ==
layout
.
hadOverflow
() &&
19
lastOwnerDirection
==
layout
.
lastOwnerDirection
&&
20
nextCachedMeasurementsIndex
==
layout
.
nextCachedMeasurementsIndex
&&
21
cachedLayout
==
layout
.
cachedLayout
&&
22
computedFlexBasis
==
layout
.
computedFlexBasis
;
23
24
for
(
uint32_t
i
=
0
;
i
<
YG_MAX_CACHED_RESULT_COUNT
&&
isEqual
; ++
i
) {
25
isEqual
=
isEqual
&&
cachedMeasurements
[
i
]
==
layout
.
cachedMeasurements
[
i
];
26
}
27
28
if
(!
yoga::
isUndefined
(
value:
measuredDimensions
[
0
]
) ||
29
!
yoga::
isUndefined
(
value:
layout
.
measuredDimensions
[
0
]
)) {
30
isEqual
=
31
isEqual
&& (
measuredDimensions
[
0
]
==
layout
.
measuredDimensions
[
0
]
);
32
}
33
if
(!
yoga::
isUndefined
(
value:
measuredDimensions
[
1
]
) ||
34
!
yoga::
isUndefined
(
value:
layout
.
measuredDimensions
[
1
]
)) {
35
isEqual
=
36
isEqual
&& (
measuredDimensions
[
1
]
==
layout
.
measuredDimensions
[
1
]
);
37
}
38
39
return
isEqual
;
40
}
41