168 Commits

Author SHA1 Message Date
Scott Goodson
1872ac07aa [ASTextNode] Renderer should not be invalidated if bounds size matches calculatedSize, even if it doesn't match constrainedSize. 2015-12-17 22:12:29 -08:00
appleguy
d56a53d9aa Merge pull request #941 from samhsiung/fix_truncation
Fix ASTextNode truncated size calculation ignoring attributes in the last line, by syncing the truncationString's attributes with the primary attributedString.
2015-12-17 18:17:48 -08:00
Scott Goodson
f44c829564 ASTextNode shouldn't create a long press gesture recognizer unless the delegate cares about the callback. 2015-12-16 17:20:08 -08:00
Samuel Hsiung
f9d476e170 Fix ASTextNode truncated size calculation ignoring attributes in the last line 2015-12-15 10:09:03 -08:00
Alexey Glushkov
ad282132ff merge master 2015-12-08 22:04:34 +03:00
Adlai Holler
835acd6a25 Change assumed value for text node highlighting delegate method to YES and don't consult it unless highlighting. 2015-12-03 20:52:02 -08:00
Adlai Holler
f39105a8f4 Optimize 2015-12-03 09:45:45 -08:00
Adlai Holler
f723452756 Allow link taps to continue if touches move within the same link 2015-12-03 09:25:37 -08:00
Levi McCallum
2cf4b22c96 Include correct TextKit headers 2015-11-30 06:46:53 -08:00
Levi McCallum
c1f4456fd5 Use composed attributed truncation string for underlying drawing text 2015-11-30 06:44:53 -08:00
Levi McCallum
397e5b15e9 Fix tabbing on initializer 2015-11-30 06:44:53 -08:00
Levi McCallum
a0c05ebffc Rename CK classes to AS classes 2015-11-30 06:44:53 -08:00
Levi McCallum
de66819286 Implement functioning isTruncated API on ASTextNode 2015-11-30 06:41:41 -08:00
Levi McCallum
74435fb584 Convert ASTextNode to support CKTextKitRenderer 2015-11-30 06:41:41 -08:00
Alexey Glushkov
c501e46b5d removed wrong conditions in _needInvalidateRenderer 2015-11-24 11:35:20 +03:00
Alexey Glushkov
01a2fd90d4 removed displaySize method, added condition to skip _invalidateRendererIfNeeded if there are no view and no layer 2015-11-24 11:12:36 +03:00
Alexey Glushkov
e859f9a870 fixed brace style 2015-11-24 10:10:34 +03:00
Alexey Glushkov
38ded30da9 add layer backed text node support for the fix 2015-11-24 10:01:02 +03:00
Alexey Glushkov
42f56defbf ASTextNode wrong text layout fix 2015-11-22 11:56:12 +03:00
Scott Goodson
3416450f11 Adding ASButtonNode. Simple but flexible, add features as desired! 2015-10-31 15:12:05 -07:00
Scott Goodson
3175ce2fe7 Fix retain cycle in basic, cache-less ASNetworkImageNodes
This should not directly affect more complex apps that don't use the ASBasicImageDownloader.

Also disables the default-on text placeholders, as they churn memory during the measurement pass.
These were intended to be written with pure layers (without using backing stores), so I don't
think it is a reasonable default-on behavior until that is fixed.
2015-10-30 22:42:05 -07:00
ricky cancro
89a216b90d Fixes to baseline stack alignment
1) Set the ascender/descender of an ASTextNode when the attributeString is set. Previously ascender/descender were only being computed in `setValuesFromLayoutable` and only when the attribute string was not nil. May make sense to remove the computation from `setValuesFromLayoutable` entirely.
2) Remove ability to allow different children of a stack spec to aling to different baselines. This wasn't working before and I'm not convinced it is possible to do properly/useful enough to invest the time.
3) Have all stack spec run `ASStackBaselinePositionedLayout::compute` to compute the stack's ascender and descender. Even if the stack isn't aligning its children to a baseline, the stack itself may be a child of another stack that IS aligning to a baseline.
2015-10-06 21:41:39 -07:00
Adlai Holler
1801620094 Make ASTextNode copy exclusionPaths and attributedString 2015-10-06 00:46:20 -07:00
Adlai Holler
ae3eb70f6a Public API fast paths in ASTextNode 2015-10-06 00:40:33 -07:00
Adlai Holler
4ef2e572e6 Elevate ceilPixel functions to ASTextNodeTextKitHelpers.h, add ceilSize 2015-09-20 21:17:24 -07:00
rcancro
2f3562fa09 scott's comments 2015-09-15 09:11:19 -07:00
rcancro
01be5acece added a callback for initWithViewBlock/initWithLayerBlock 2015-09-14 20:36:08 -07:00
rcancro
15b3fd6eab Moved ASLayoutable* properties into ASLayoutOptions class 2015-09-08 09:50:27 -07:00
rcancro
9036ab8e7d new stack layout spec for text 2015-08-22 19:03:54 -07:00
ricky cancro
ef89f758bc flailing 2015-08-22 19:03:54 -07:00
ricky cancro
cf428831a4 Added baseline spacing for vertical stack views. 2015-08-22 19:03:54 -07:00
ricky cancro
f289b3345a Add baseline support to ASStackLayoutSpec 2015-08-22 19:03:54 -07:00
Ethan Nagel
f7fb6dc4e7 Node init performance: Use share instances of UIColor and NSAttributedString for defaults. 2015-08-17 12:23:25 -07:00
Shannon Ma
15133fdbf7 setNeedsDisplay must be called on main 2015-07-31 12:11:19 -07:00
Huy Nguyen
af64f33ed7 Minor changes: remove unncessary imports and add a new line ad the end of ASInternalHelpers.h 2015-07-01 18:36:36 +07:00
Huy Nguyen
2149d44990 Fix naming convetion:
- "Layout node" is changed to "layout spec".
- Update tests.
- Update Kittens sample.
2015-07-01 18:13:44 +07:00
Huy Nguyen
dd29a890df Still support -calculateLayoutThatFits: (and manual layout), for backward compatibility. 2015-06-28 20:31:32 +07:00
Huy Nguyen
f588bceb4d Introduce ASLayoutable and eliminate ASCompositeNode:
- 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.
2015-06-26 09:29:16 +07:00
Huy Nguyen
abe98d5b09 Integrate new layout nodes to the framework.
- 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.
2015-06-25 11:34:35 +07:00
appleguy
2bc0da021f Merge pull request #439 from eanagel/passthrough-nonlink-touches
Add option to pass through touches to non-link text in ASTextNode
2015-06-06 19:25:39 -07:00
Scott Goodson
e3f0e66cb3 Updating API names for network range and memory culling before ASDK 1.2 tag. 2015-05-21 22:43:38 -10:00
Ethan Nagel
a0ec62b282 Add option to pass through touches to non-link text (disabled by default.) 2015-04-27 17:59:59 -07:00
Tobias Klonk
2a29f81b3a ASTextNode expose exclusion paths
expose NSTextContainer's exclusionPaths property on ASTextNode to be able to exclude view areas from typesetting.

This implements #394
2015-04-20 10:21:01 +02:00
Michael Kuntscher
a92dd3189b Adds property for long press touch cancellation 2015-04-01 16:38:29 -07:00
Ryan Nystrom
b6715b5cf9 Forward touches to super instead of the superview
fixes #402
2015-03-26 21:11:13 -07:00
Nadine Salter
8164d63d29 Fix ASTextNode positioning for non-left alignment, part deux.
Apply the fix from #329 to `-setFrame:`.  Fixes #89.
2015-03-20 12:45:06 -07:00
Ryan Nystrom
b6dea69070 Text placeholders snap to pixels 2015-03-11 13:56:12 -07:00
Ryan Nystrom
4fa03a01d1 Functioning Preload range
Refactor how we do ranges so they can be arbitrarily managed. Introduce the concept of a preload range.
2015-02-26 15:41:32 -08:00
Oliver Clark Rickard
582c11d447 Fix text node positioning for non-left alignment 2015-02-24 14:31:08 -05:00
Ryan Nystrom
478b4c7bab Allow touches and long press on ASTextNode
fixes #262
2015-02-11 18:04:22 -08:00