mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Fabric: AttributedString::operator==() now checks layoutMetrics for being equal
Summary: The sizes of attachments are legit parts of `AttributedString`s identity, so we need to incorporate it into the equality test. We need that to make measurement cache work correctly with inline views. Changelog: [Internal] Fabric-specific internal change. Reviewed By: mdvacca Differential Revision: D20151505 fbshipit-source-id: ae47c24a753eab1e497fcfaa93de557ffb30d874
This commit is contained in:
committed by
Facebook Github Bot
parent
6f4d362887
commit
061f54e890
@@ -26,8 +26,16 @@ bool Fragment::isAttachment() const {
|
||||
}
|
||||
|
||||
bool Fragment::operator==(const Fragment &rhs) const {
|
||||
return std::tie(string, textAttributes, parentShadowView.tag) ==
|
||||
std::tie(rhs.string, rhs.textAttributes, rhs.parentShadowView.tag);
|
||||
return std::tie(
|
||||
string,
|
||||
textAttributes,
|
||||
parentShadowView.tag,
|
||||
parentShadowView.layoutMetrics) ==
|
||||
std::tie(
|
||||
rhs.string,
|
||||
rhs.textAttributes,
|
||||
rhs.parentShadowView.tag,
|
||||
rhs.parentShadowView.layoutMetrics);
|
||||
}
|
||||
|
||||
bool Fragment::operator!=(const Fragment &rhs) const {
|
||||
|
||||
Reference in New Issue
Block a user