mirror of
https://github.com/HackPlan/AsyncDisplayKit.git
synced 2026-04-23 11:27:56 +08:00
# The first commit's message is: # This is a combination of 30 commits. # The first commit's message is: Update nav_docs.yml # This is the 2nd commit message: Create node-containers-overview.md # This is the 3rd commit message: Update node-containers-overview.md # This is the 4th commit message: Update node-containers-overview.md # This is the 5th commit message: Update node-containers-overview.md # This is the 6th commit message: Update node-containers-overview.md # This is the 7th commit message: Update nav_docs.yml # This is the 8th commit message: Update nav_docs.yml # This is the 9th commit message: Update and rename node-containers-overview.md to containers-overview.md # This is the 10th commit message: Update and rename asviewcontroller.md to container-asviewcontroller.md # This is the 11th commit message: Update and rename astablenode.md to container-astablenode.md # This is the 12th commit message: Update and rename ascollectionnode.md to container-ascollectionnode.md # This is the 13th commit message: Update and rename aspagernode.md to container-aspagernode.md # This is the 14th commit message: Update and rename container-ascollectionnode.md to containers-ascollectionnode.md # This is the 15th commit message: Update and rename container-asviewcontroller.md to containers-asviewcontroller.md # This is the 16th commit message: Update containers-ascollectionnode.md # This is the 17th commit message: Update container-astablenode.md # This is the 18th commit message: Rename container-astablenode.md to containers-astablenode.md # This is the 19th commit message: Update and rename container-aspagernode.md to containers-aspagernode.md # This is the 20th commit message: Update containers-overview.md # This is the 21st commit message: Update containers-overview.md # This is the 22nd commit message: Update containers-overview.md # This is the 23rd commit message: Update containers-asviewcontroller.md # This is the 24th commit message: Update containers-asviewcontroller.md # This is the 25th commit message: Update containers-overview.md # This is the 26th commit message: Update containers-asviewcontroller.md # This is the 27th commit message: Update containers-asviewcontroller.md # This is the 28th commit message: Update containers-asviewcontroller.md # This is the 29th commit message: Update containers-overview.md # This is the 30th commit message: Update containers-overview.md # This is the 2nd commit message: Removing _site folder from repository (only needed to run locally) # This is the 3rd commit message: Update containers-overview.md # This is the 4th commit message: Update containers-overview.md # This is the 5th commit message: Update containers-asviewcontroller.md # This is the 6th commit message: Update debug-tool-pixel-scaling.md # This is the 7th commit message: Update debug-tool-pixel-scaling.md # This is the 8th commit message: Update debug-tool-pixel-scaling.md # This is the 9th commit message: Update debug-tool-pixel-scaling.md # This is the 10th commit message: Update debug-tool-pixel-scaling.md # This is the 11th commit message: Update debug-tool-pixel-scaling.md # This is the 12th commit message: Update debug-tool-pixel-scaling.md # This is the 13th commit message: Update debug-tool-hit-test-slop.md # This is the 14th commit message: Update debug-tool-hit-test-slop.md # This is the 15th commit message: Update nav_docs.yml # This is the 16th commit message: Update image-node.md # This is the 17th commit message: Update image-node.md # This is the 18th commit message: Update control-node.md # This is the 19th commit message: Update control-node.md # This is the 20th commit message: Update nav_docs.yml # This is the 21st commit message: Create batch-fetching-api.md # This is the 22nd commit message: Update batch-fetching-api.md # This is the 23rd commit message: Update debug-tool-hit-test-slop.md # This is the 24th commit message: Update debug-tool-pixel-scaling.md # This is the 25th commit message: Update debug-tool-hit-test-slop.md # This is the 26th commit message: Update debug-tool-pixel-scaling.md # This is the 27th commit message: Update containers-aspagernode.md # This is the 28th commit message: Update containers-aspagernode.md # This is the 29th commit message: Update containers-aspagernode.md # This is the 30th commit message: Update containers-aspagernode.md # This is the 31st commit message: Update containers-asviewcontroller.md # This is the 32nd commit message: Update containers-asviewcontroller.md # This is the 33rd commit message: Update containers-asviewcontroller.md # This is the 34th commit message: Update containers-asviewcontroller.md # This is the 35th commit message: Update containers-overview.md # This is the 36th commit message: Update containers-asviewcontroller.md # This is the 37th commit message: Update containers-astablenode.md # This is the 38th commit message: Update containers-astablenode.md # This is the 39th commit message: Update containers-astablenode.md # This is the 40th commit message: Update containers-astablenode.md # This is the 41st commit message: Update containers-astablenode.md # This is the 42nd commit message: Update containers-astablenode.md # This is the 43rd commit message: Update containers-astablenode.md # This is the 44th commit message: Update containers-astablenode.md
1.6 KiB
1.6 KiB
title, layout, permalink, next
| title | layout | permalink | next |
|---|---|---|---|
| Image Scaling | docs | /docs/debug-tool-pixel-scaling.html | debug-tool-hit-test-slop.html |
##Visualize ASImageNode.image’s pixel scaling## This debug feature adds a red text overlay on the bottom right hand corner of an ASImageNode if (and only if) the image’s size in pixels does not match it’s bounds size in pixels, e.g.
imageSizeInPixels = image.size * image.scale
boundsSizeInPixels = bounds.size * contentsScale
scaleFactor = imageSizeInPixels / boundsSizeInPixels
if (scaleFactor != 1.0) {
NSString *scaleString = [NSString stringWithFormat:@"%.2fx", scaleFactor];
_debugLabelNode.hidden = NO;
}
This debug feature is useful for quickly determining if you are
- downloading and rendering excessive amounts of image data
- upscaling a low quality image
In the screenshot below of an app with this debug feature enabled, you can see that the avatar image is unnecessarily large (9x too large) for it’s bounds size and that the center picture is more optimized, but not perfectly so. If you control your own endpoint, optimize your API / app to return an optimally sized image.
##Usage##
In your AppDelegate.m file,
- import `AsyncDisplayKit+Debug.h`
- add `[ASImageNode setShouldShowImageScalingOverlay:YES]` at the top of your `didFinishLaunchingWithOptions:` method