mirror of
https://github.com/HackPlan/AsyncDisplayKit.git
synced 2026-04-24 03:45:58 +08:00
[ASTextNode] placeholder image shouldn't draw for zero area strings (#2069)
* placeholder should not draw if area is zero * styling fix * super precision
This commit is contained in:
committed by
Adlai Holler
parent
56ee00986f
commit
14ccb0b886
@@ -27,6 +27,8 @@
|
||||
#import "ASInternalHelpers.h"
|
||||
#import "ASLayout.h"
|
||||
|
||||
#import "CGRect+ASConvenience.h"
|
||||
|
||||
static const NSTimeInterval ASTextNodeHighlightFadeOutDuration = 0.15;
|
||||
static const NSTimeInterval ASTextNodeHighlightFadeInDuration = 0.1;
|
||||
static const CGFloat ASTextNodeHighlightLightOpacity = 0.11;
|
||||
@@ -910,7 +912,7 @@ static CGRect ASTextNodeAdjustRenderRectForShadowPadding(CGRect rendererRect, UI
|
||||
// FIXME: Replace this implementation with reusable CALayers that have .backgroundColor set.
|
||||
// This would completely eliminate the memory and performance cost of the backing store.
|
||||
CGSize size = self.calculatedSize;
|
||||
if (CGSizeEqualToSize(size, CGSizeZero)) {
|
||||
if ((size.width * size.height) < CGFLOAT_EPSILON) {
|
||||
return nil;
|
||||
}
|
||||
|
||||
|
||||
@@ -14,6 +14,14 @@
|
||||
#import "ASBaseDefines.h"
|
||||
#import "ASLayoutController.h"
|
||||
|
||||
#ifndef CGFLOAT_EPSILON
|
||||
#if CGFLOAT_IS_DOUBLE
|
||||
#define CGFLOAT_EPSILON DBL_EPSILON
|
||||
#else
|
||||
#define CGFLOAT_EPSILON FLT_EPSILON
|
||||
#endif
|
||||
#endif
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
ASDISPLAYNODE_EXTERN_C_BEGIN
|
||||
|
||||
Reference in New Issue
Block a user