Avoid serializing UndefinedColor when rendering texts
Summary: This diff avoids the serialization of color that are set as: "UndefinedColor". This allows the text rendering system to set the default color in the native side Reviewed By: shergin Differential Revision: D10275834 fbshipit-source-id: b81c7a5995bef65e04a246d99f44ff10cb20f548
This commit is contained in:
Родитель
397573ffed
Коммит
28d80e4717
|
@ -387,7 +387,9 @@ inline folly::dynamic toDynamic(
|
||||||
|
|
||||||
inline folly::dynamic toDynamic(const TextAttributes &textAttributes) {
|
inline folly::dynamic toDynamic(const TextAttributes &textAttributes) {
|
||||||
auto _textAttributes = folly::dynamic::object();
|
auto _textAttributes = folly::dynamic::object();
|
||||||
|
if (textAttributes.foregroundColor) {
|
||||||
_textAttributes("foregroundColor", toDynamic(textAttributes.foregroundColor));
|
_textAttributes("foregroundColor", toDynamic(textAttributes.foregroundColor));
|
||||||
|
}
|
||||||
if (textAttributes.backgroundColor) {
|
if (textAttributes.backgroundColor) {
|
||||||
_textAttributes(
|
_textAttributes(
|
||||||
"backgroundColor", toDynamic(textAttributes.backgroundColor));
|
"backgroundColor", toDynamic(textAttributes.backgroundColor));
|
||||||
|
|
Загрузка…
Ссылка в новой задаче