12
12
#include < react/renderer/core/graphicsConversions.h>
13
13
#include < react/renderer/core/propsConversions.h>
14
14
#include < react/renderer/debug/DebugStringConvertibleItem.h>
15
+ #include < react/utils/FloatComparison.h>
15
16
16
17
namespace facebook ::react {
17
18
@@ -377,12 +378,14 @@ void BaseTextProps::appendTextAttributesProps(
377
378
result[" fontFamily" ] = textAttributes.fontFamily ;
378
379
}
379
380
380
- if (textAttributes.fontSize != oldProps->textAttributes .fontSize ) {
381
+ if (!floatEquality (
382
+ textAttributes.fontSize , oldProps->textAttributes .fontSize )) {
381
383
result[" fontSize" ] = textAttributes.fontSize ;
382
384
}
383
385
384
- if (textAttributes.fontSizeMultiplier !=
385
- oldProps->textAttributes .fontSizeMultiplier ) {
386
+ if (!floatEquality (
387
+ textAttributes.fontSizeMultiplier ,
388
+ oldProps->textAttributes .fontSizeMultiplier )) {
386
389
result[" fontSizeMultiplier" ] = textAttributes.fontSizeMultiplier ;
387
390
}
388
391
@@ -411,8 +414,9 @@ void BaseTextProps::appendTextAttributesProps(
411
414
: folly::dynamic (nullptr );
412
415
}
413
416
414
- if (textAttributes.maxFontSizeMultiplier !=
415
- oldProps->textAttributes .maxFontSizeMultiplier ) {
417
+ if (!floatEquality (
418
+ textAttributes.maxFontSizeMultiplier ,
419
+ oldProps->textAttributes .maxFontSizeMultiplier )) {
416
420
result[" maxFontSizeMultiplier" ] = textAttributes.maxFontSizeMultiplier ;
417
421
}
418
422
@@ -423,7 +427,9 @@ void BaseTextProps::appendTextAttributesProps(
423
427
: nullptr ;
424
428
}
425
429
426
- if (textAttributes.letterSpacing != oldProps->textAttributes .letterSpacing ) {
430
+ if (!floatEquality (
431
+ textAttributes.letterSpacing ,
432
+ oldProps->textAttributes .letterSpacing )) {
427
433
result[" letterSpacing" ] = textAttributes.letterSpacing ;
428
434
}
429
435
@@ -440,7 +446,8 @@ void BaseTextProps::appendTextAttributesProps(
440
446
: nullptr ;
441
447
}
442
448
443
- if (textAttributes.lineHeight != oldProps->textAttributes .lineHeight ) {
449
+ if (!floatEquality (
450
+ textAttributes.lineHeight , oldProps->textAttributes .lineHeight )) {
444
451
result[" lineHeight" ] = textAttributes.lineHeight ;
445
452
}
446
453
@@ -500,8 +507,9 @@ void BaseTextProps::appendTextAttributesProps(
500
507
: nullptr ;
501
508
}
502
509
503
- if (textAttributes.textShadowRadius !=
504
- oldProps->textAttributes .textShadowRadius ) {
510
+ if (!floatEquality (
511
+ textAttributes.textShadowRadius ,
512
+ oldProps->textAttributes .textShadowRadius )) {
505
513
result[" textShadowRadius" ] = textAttributes.textShadowRadius ;
506
514
}
507
515
0 commit comments