This repository has been archived by the owner on Feb 2, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1336 from hannahmbanana/ASImageNodeScaleFactorLabel
[ASImageNode] An ASImageNode debug feature showing pixel scaling amount
- Loading branch information
Showing
5 changed files
with
121 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
// | ||
// AsyncDisplayKit+Debug.h | ||
// AsyncDisplayKit | ||
// | ||
// Created by Hannah Troisi on 3/7/16. | ||
// Copyright © 2016 Facebook. All rights reserved. | ||
// | ||
|
||
#import <Foundation/Foundation.h> | ||
#import "ASImageNode.h" | ||
|
||
@interface ASImageNode (Debugging) | ||
|
||
/** | ||
* Enables an ASImageNode debug label that shows the ratio of pixels in the source image to those in | ||
* the displayed bounds (including cropRect). This helps detect excessive image fetching / downscaling, | ||
* as well as upscaling (such as providing a URL not suitable for a Retina device). For dev purposes only. | ||
* @param enabled Specify YES to show the label on all ASImageNodes with non-1.0x source-to-bounds pixel ratio. | ||
*/ | ||
+ (void)setShouldShowImageScalingOverlay:(BOOL)show; | ||
+ (BOOL)shouldShowImageScalingOverlay; | ||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
// | ||
// AsyncDisplayKit+Debug.m | ||
// AsyncDisplayKit | ||
// | ||
// Created by Hannah Troisi on 3/7/16. | ||
// Copyright © 2016 Facebook. All rights reserved. | ||
// | ||
|
||
#import "AsyncDisplayKit+Debug.h" | ||
#import "ASDisplayNode+Subclasses.h" | ||
|
||
static BOOL __shouldShowImageScalingOverlay = NO; | ||
|
||
@implementation ASImageNode (Debugging) | ||
|
||
+ (void)setShouldShowImageScalingOverlay:(BOOL)show; | ||
{ | ||
__shouldShowImageScalingOverlay = show; | ||
} | ||
|
||
+ (BOOL)shouldShowImageScalingOverlay | ||
{ | ||
return __shouldShowImageScalingOverlay; | ||
} | ||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters