mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-09-07 05:02:56 +00:00
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.
18 lines
401 B
Objective-C
18 lines
401 B
Objective-C
//
|
|
// ASTextNode+Beta.h
|
|
// AsyncDisplayKit
|
|
//
|
|
// Created by Luke on 1/25/16.
|
|
// Copyright © 2016 Facebook. All rights reserved.
|
|
//
|
|
|
|
|
|
@interface ASTextNode ()
|
|
|
|
/**
|
|
@abstract An array of descending scale factors that will be applied to this text node to try to make it fit within its constrained size
|
|
@default nil (no scaling)
|
|
*/
|
|
@property (nonatomic, copy) NSArray *pointSizeScaleFactors;
|
|
|
|
@end |