Michael Schneider
a9d0542d8f
If trailing rect was set early return
2016-04-15 07:10:22 -07:00
Michael Schneider
91b6995987
Fix deadlock calling trailingRect on a ASTextNode
2016-04-15 07:10:22 -07:00
appleguy
ea935456b8
Merge pull request #1437 from ejensen/editable-text-node-layout-manager
...
[ASEditableTextNode] Allow TextKit component customization
2016-03-31 20:46:19 -07:00
Scott Goodson
daf41ebb43
[ASTextNode] Fix edge case where text truncator may not run (manually hosted nodes that are lacking the expected call to -measure).
...
This fixes the scenario described in https://github.com/facebook/AsyncDisplayKit/issues/1295
2016-03-26 18:19:02 -07:00
Eric Jensen
387abbff5d
Rename ASTextKitHelpers to ASTextKitComponents and make the header public
2016-03-26 15:31:53 -07:00
Eric Jensen
0758475409
Remove unnecessary imports
2016-03-25 22:33:02 -07:00
Eric Jensen
f8f3585764
Add a ASTextKitComponents initializer that allows customization of its NSTextStorage and NSLayoutManager
2016-03-25 22:12:19 -07:00
Eric Jensen
057ec55941
Correct documentation comments
2016-03-24 20:08:03 -07:00
Scott Goodson
8308a4ce49
[AsyncDisplayKit] Adopt #pragma once, remove last remaining dispatch_sync (UIScreen scale).
2016-03-19 19:56:41 -07:00
Eric Jensen
14a389c5e0
Replace ASTextKitAttributes' objectsEqual with the shared ASObjectIsEqual
2016-03-17 10:36:35 -07:00
appleguy
d9ef0922d8
Merge pull request #1354 from ejensen/cleanup
...
[Refactoring] Objective-C 2.0 / Modern syntax for arrays, dictionaries, numbers; logic simplification
2016-03-17 01:06:33 -07:00
Eric Jensen
33fda7ab49
- Use modern Objective-C syntax.
...
- Simplify comparisons.
- Remove dead stores.
2016-03-15 22:34:29 -07:00
Eric Jensen
ddd5ff1f75
Correct spelling errors
2016-03-15 21:56:51 -07:00
appleguy
d40b6c61c8
Merge pull request #1352 from ejensen/deprecated-enum
...
[ASTextKit] Update usage of deprecated NSControlCharacterAction value
2016-03-10 00:28:02 -08:00
rcancro
bcb1832fcd
Fixed some text shrinking issues
...
Previously I was multiplying the calculated height of the text by the scale factor. This fails in the case where we have a long string that doesn't fit, but it is shrunk so much that it now has more than enough room in the renderer's constrained size. In this case we fail to update the calculated size's width.
Also updated `lineCountForString` in `ASTextKitFontSizeAdjuster` to reuse a sizer layout manager and text container.
2016-03-09 15:27:33 -08:00
Eric Jensen
9d4c53b0fa
Replace usage of deprecated NSControlCharacterAction value
2016-03-09 11:44:13 -08:00
appleguy
de4e4db671
Merge pull request #1340 from ejensen/documentation-corrections
...
[Documentation] Various header documentation corrections and refinements.
2016-03-09 02:52:48 -08:00
rcancro
3ebdf5928c
Made a few changes to font scale adjustment
...
1) cache the scale in the font adjuster. The adjuster will be dealloc'ed when the renderer that owns it is dealloc'ed (or invalidated). Until that time we can trust the scale that the adjuster has computed.
2) When measuring line count, make sure that we are not bounding the height of the container's size. This will cause the wrong number of lines to be returned.
3) Instead of setting the ascender/descender on an ASTextNode when an attributed string is added, wait until after the renderer calculates size. This way, if there is any need to scale the font to fit we can apply that scale to the ascender/descender.
2016-03-08 12:05:26 -08:00
Eric Jensen
86ccd33a84
Correct a few documentation comments for method parameters
2016-03-08 11:56:58 -08:00
rcancro
8dbc8b7df4
reordered conditionals, moved beta things to beta header file
2016-02-24 08:06:10 -08:00
rcancro
878fedd8f3
Stopped trying to cache the currentScaleFactor
...
Was running into issues where the scale factor would get cleared when setting a new atributedString on a textNode.
I was clearing out the currentScaleFactor when setting an attributedString into a textNode. It appears that `_calculateSize` isn't always called when setting a new string into a ASTextNode. It can be the case that only `drawInContext:bounds:` is called. With _currentScaleFactor cleared out the renderer that calls`drawInContext...` was being called with a scaleFactor of 0.
It could be the case that the fix could be to remove the clearing of `currentScaleFactor` from `setAttributedString`, but this seems like a safer fix to me. It does, however, require an extra run through the font adjuster when enabled.
2016-02-23 16:51:10 -08:00
rcancro
00b0968bf7
Add ability to customize NSLayoutManager and NSTextStorage when created in the ASTextKitContext
2016-02-22 13:00:02 -08:00
rcancro
0e7fae1825
reverted some debug code
2016-02-16 16:16:29 -08:00
rcancro
a920e353c6
adjust font size to make text fit within constrained size
...
# Conflicts:
# AsyncDisplayKit/ASTextNode.mm
2016-02-16 16:16:22 -08:00
Tom King
d0edbe809a
ensure that the truncater is initialized before the context is in _calculateSize
2016-01-29 09:32:40 -05:00
appleguy
2c194fd924
Merge pull request #1140 from rcancro/textNodeWordSpacing
...
[ASTextNode] Added ASTextNodeWordKerner support
2016-01-28 15:38:00 -08:00
rcancro
7f6f2fed11
Added ASTextNodeWordKerner support to ASTextNode
...
* Added a member to `ASTextKitAttributes` that is an optional delegate to the struct's NSLayoutManager.
* Changed ASTextNode to set this delegate to an instance of ASTextNodeWordKerner.
* Updated init method of `ASTextKitContext` to take an optional NSLayoutManager delegate
* Added the files in TextKit folder to the public headers (so we can include ASTextNodeTypes.h)
2016-01-28 08:38:22 -08:00
appleguy
5b9be8a8c3
Merge pull request #1127 from samhsiung/foreground_color_link
...
[ASTextKit] Use NSForegroundColorAttributeName for links in ASTextKitRenderer
2016-01-27 22:42:04 -08:00
Samuel Hsiung
90ac40020f
Use NSForegroundColorAttributeName for links in ASTextNodes by subclassing NSLayoutManager
2016-01-27 21:13:28 -08:00
Luke Zhao
733c65d1eb
fix bug: constraint size not updated for frontsizeadjuster
2016-01-27 13:49:00 -08:00
yury
a3a0440a01
[text] Use the closest glyph to determine hit token
2016-01-26 22:41:02 +03:00
yury
a0b7254213
[text] Fix crash when highlighted range exceeds truncation range
2016-01-26 22:37:44 +03:00
appleguy
508e3db8ee
Merge pull request #1091 from lkzhao/ASTextKitFontSizeAdjuster
...
[ASTextNode] Support iteratively shrinking font size in order to ensure no single words are wrapped.
2016-01-25 19:36:39 -08:00
Luke Zhao
f413a618e0
add ASTextKitFontSizeAdjuster
2016-01-25 19:07:28 -08:00
yury
313a3cc63c
Create Truncater with context. So it will actually truncate string in its initializer
2016-01-25 16:48:55 +03:00
Scott Goodson
9ddf68fa96
[ASTextNode] Optimize handling of constrained size to almost never recreate NSLayoutManager
...
This also fixes two fairly subtle but serious bugs, #1076 and #1046 .
2016-01-24 00:50:43 -08:00
Aaron Schubert
10a2984d8c
Potential fix for #1076
2016-01-19 12:25:30 +00:00
Scott Goodson
882d4b336e
Merge branch 'master' into pr/664
2015-12-25 14:32:41 -08:00
Scott Goodson
99fbc97bda
Optimizations for ASTextNode handling of renderer allocation and deallocation.
...
Optimizations for ASDisplayNode handling of bridged property "contentMode", especially for layer-backed nodes.
2015-12-25 01:36:32 -08:00
Adlai Holler
69767d558e
Merge branch 'master' into update-objc
...
Conflicts:
AsyncDisplayKit/Private/ASDisplayNode+FrameworkPrivate.h
2015-12-22 00:28:21 -05:00
appleguy
3b5fb17f81
Merge pull request #942 from bsmith11/ASTextKitCoreTextAttributesBug
...
ASTextKit CoreText attributes cleansing should not remove NSParagraphStyle attributes
2015-12-17 19:18:43 -08:00
Bradley Smith
e64965c1ca
Fixed ASTextKit CoreText attributes bug which was incorrectly reading a NSParagraphStyle as CTParagraphStyleRef
2015-12-15 14:41:37 -05:00
Samuel Hsiung
f9d476e170
Fix ASTextNode truncated size calculation ignoring attributes in the last line
2015-12-15 10:09:03 -08:00
Adlai Holler
fdfe18873a
Merge branch 'master' into update-objc
...
Conflicts:
AsyncDisplayKit/ASDisplayNodeExtras.h
AsyncDisplayKit/Details/ASTextNodeRenderer.h
AsyncDisplayKit/Details/ASTextNodeShadower.h
2015-12-01 16:45:25 -08:00
Levi McCallum
04ad021daa
Rename positioning block to sport as namespace
2015-11-30 06:55:32 -08:00
Levi McCallum
cd78bcce99
Convert naming of hash helpers to AS namespace
2015-11-30 06:53:50 -08:00
Levi McCallum
a0c05ebffc
Rename CK classes to AS classes
2015-11-30 06:44:53 -08:00
Levi McCallum
74435fb584
Convert ASTextNode to support CKTextKitRenderer
2015-11-30 06:41:41 -08:00
Levi McCallum
bae3e3b63d
Add latest ComponentKit text kit renderer into project
2015-11-30 06:41:40 -08:00