* [Optimization] Convert to type-generic math
* add std:: prefix in obj-c++ files
* more cleanup
* revert test changes
* convert min and max back to fmin/fmax
Using Objective-C attributes, in this case `unavailable`, we can hide
unsupported APIs at compile time instead of detecting and warn about it
at runtime with a set of asserts.
Rounding up to the next device pixel was calculating a height smaller
than UITextView's contentSize. This was causing the baseline to move as
the user was typing.
- Add ability to measure the ASEditableTextNode based on the content now by calling measure:
- ASEditableTextNode considers preferredFrameSize now
- Fix crash if ASEditableTextNode is included in a horizontal stack
- Add tests for ASEditableTextNode
Previously, it was only possible to configure the textContainerInset of the typed textView by accessing the textView property on didLoad. This would cause the placeholder and typed textViews to become desynced however, so in this commit we add the ability to configure both.
When setting a default placeholder and an attributedString before `_textKitComponents.textView` was created, the placeholder and the string were both appearing in the text node.
`_updateDisplayingPlaceholder` is called in `setAttributedString`, but since `_textKitComponents.textView` is nil the placeholder was not hidden. Calling `_updateDisplayingPlaceholder` after `_textKitComponents.textView` loads fixes this.
- Both ASDisplayNode and ASLayoutNode conforms to this protocol.
- ASDisplayNode can be embeded directly into layout graph.
- Eliminate ASCompositeNode.
- Fix ASStaticSizeDisplayNode not recpect min constrained size.
- Updated tests.
- Introduce ASLayoutNode and its subclasses.
- ASDisplayNode measures its ASLayoutNode and cache the result (ASLayout). Calculated size and position of each subnode can be retrieved from the calculated layout.
- Custom nodes need to override -layoutNodeThatFits:(CGSize) instead of -calculateSizeThatFits:(CGSize).
- Custom nodes do not need to layout its subnodes (in -layout:) anymore. ASDisplayNode can handle the job most of the time, by walking through its layout tree.
- ASCompositeNode is used to embed (display) subnodes to a node's layout. That way, each subnode will also be measured while the parent node is measuring. And the parent node knows where its subnodes are within its layout.
ARC doesn't play nicely with structs that contain references to
Objective-C objects, which causes breakage when using AsyncDisplayKit as
a dynamic framework (e.g., with CocoaPods 0.36+). Fixes#198.