mirror of
https://github.com/TextureGroup/Texture.git
synced 2026-04-07 19:17:39 +00:00
Use CAEdgeAntialiasingMask instead of unsigned int (#1667)
This commit is contained in:
committed by
Greg Bolsinga
parent
5e7fbf2ff9
commit
c99bcb02f8
@@ -734,7 +734,7 @@ AS_EXTERN NSInteger const ASDefaultDrawingPriority;
|
||||
|
||||
@property BOOL allowsGroupOpacity;
|
||||
@property BOOL allowsEdgeAntialiasing;
|
||||
@property unsigned int edgeAntialiasingMask; // default==all values from CAEdgeAntialiasingMask
|
||||
@property CAEdgeAntialiasingMask edgeAntialiasingMask; // default==all values from CAEdgeAntialiasingMask
|
||||
|
||||
@property BOOL needsDisplayOnBoundsChange; // default==NO
|
||||
@property BOOL autoresizesSubviews; // default==YES (undefined for layer-backed nodes)
|
||||
|
||||
@@ -42,7 +42,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
@property (nonatomic) UIColor *backgroundColor;
|
||||
@property (nonatomic) BOOL allowsGroupOpacity;
|
||||
@property (nonatomic) BOOL allowsEdgeAntialiasing;
|
||||
@property (nonatomic) unsigned int edgeAntialiasingMask;
|
||||
@property (nonatomic) CAEdgeAntialiasingMask edgeAntialiasingMask;
|
||||
@property (nonatomic, nullable, copy) NSDictionary<NSString *, id<CAAction>> *actions;
|
||||
|
||||
- (void)setNeedsDisplay;
|
||||
|
||||
@@ -929,13 +929,13 @@ if (shouldApply) { _layer.layerProperty = (layerValueExpr); } else { ASDisplayNo
|
||||
_setToLayer(allowsEdgeAntialiasing, allowsEdgeAntialiasing);
|
||||
}
|
||||
|
||||
- (unsigned int)edgeAntialiasingMask
|
||||
- (CAEdgeAntialiasingMask)edgeAntialiasingMask
|
||||
{
|
||||
_bridge_prologue_read;
|
||||
return _getFromLayer(edgeAntialiasingMask);
|
||||
}
|
||||
|
||||
- (void)setEdgeAntialiasingMask:(unsigned int)edgeAntialiasingMask
|
||||
- (void)setEdgeAntialiasingMask:(CAEdgeAntialiasingMask)edgeAntialiasingMask
|
||||
{
|
||||
_bridge_prologue_write;
|
||||
_setToLayer(edgeAntialiasingMask, edgeAntialiasingMask);
|
||||
|
||||
@@ -374,7 +374,7 @@ static CGColorRef blackColorRef = NULL;
|
||||
return _flags.allowsEdgeAntialiasing;
|
||||
}
|
||||
|
||||
- (void)setEdgeAntialiasingMask:(unsigned int)mask
|
||||
- (void)setEdgeAntialiasingMask:(CAEdgeAntialiasingMask)mask
|
||||
{
|
||||
edgeAntialiasingMask = mask;
|
||||
_stateToApplyFlags.setEdgeAntialiasingMask = YES;
|
||||
|
||||
@@ -465,7 +465,7 @@ for (ASDisplayNode *n in @[ nodes ]) {\
|
||||
XCTAssertEqual(NO, node.needsDisplayOnBoundsChange, @"default needsDisplayOnBoundsChange broken %@", hasLoadedView);
|
||||
XCTAssertEqual(YES, node.allowsGroupOpacity, @"default allowsGroupOpacity broken %@", hasLoadedView);
|
||||
XCTAssertEqual(NO, node.allowsEdgeAntialiasing, @"default allowsEdgeAntialiasing broken %@", hasLoadedView);
|
||||
XCTAssertEqual((unsigned int)(kCALayerLeftEdge | kCALayerRightEdge | kCALayerBottomEdge | kCALayerTopEdge), node.edgeAntialiasingMask, @"default edgeAntialisingMask broken %@", hasLoadedView);
|
||||
XCTAssertEqual((kCALayerLeftEdge | kCALayerRightEdge | kCALayerBottomEdge | kCALayerTopEdge), node.edgeAntialiasingMask, @"default edgeAntialisingMask broken %@", hasLoadedView);
|
||||
XCTAssertEqual(NO, node.hidden, @"default hidden broken %@", hasLoadedView);
|
||||
XCTAssertEqual(1.0f, node.alpha, @"default alpha broken %@", hasLoadedView);
|
||||
XCTAssertTrue(CGRectEqualToRect(CGRectZero, node.bounds), @"default bounds broken %@", hasLoadedView);
|
||||
@@ -579,7 +579,7 @@ for (ASDisplayNode *n in @[ nodes ]) {\
|
||||
XCTAssertEqual(YES, node.needsDisplayOnBoundsChange, @"needsDisplayOnBoundsChange broken %@", hasLoadedView);
|
||||
XCTAssertEqual(NO, node.allowsGroupOpacity, @"allowsGroupOpacity broken %@", hasLoadedView);
|
||||
XCTAssertEqual(YES, node.allowsEdgeAntialiasing, @"allowsEdgeAntialiasing broken %@", hasLoadedView);
|
||||
XCTAssertTrue((unsigned int)(kCALayerLeftEdge | kCALayerTopEdge) == node.edgeAntialiasingMask, @"edgeAntialiasingMask broken: %@", hasLoadedView);
|
||||
XCTAssertTrue((kCALayerLeftEdge | kCALayerTopEdge) == node.edgeAntialiasingMask, @"edgeAntialiasingMask broken: %@", hasLoadedView);
|
||||
XCTAssertEqual(YES, node.hidden, @"hidden broken %@", hasLoadedView);
|
||||
XCTAssertEqual(.5f, node.alpha, @"alpha broken %@", hasLoadedView);
|
||||
XCTAssertTrue(CGRectEqualToRect(CGRectMake(10, 15, 42, 115.2), node.bounds), @"bounds broken %@", hasLoadedView);
|
||||
|
||||
Reference in New Issue
Block a user