Various improvements

This commit is contained in:
Ilya Laktyushin
2022-05-19 21:15:31 +04:00
parent b0cb39b8cd
commit 3fb304bd6f
30 changed files with 319 additions and 136 deletions

View File

@@ -226,7 +226,7 @@ public class ASTextNode: ImmediateTextNode {
}
}
public class ImmediateTextView: TextView {
open class ImmediateTextView: TextView {
public var attributedText: NSAttributedString?
public var textAlignment: NSTextAlignment = .natural
public var verticalAlignment: TextVerticalAlignment = .top

View File

@@ -4,7 +4,7 @@ import SwiftSignalKit
private var backArrowImageCache: [Int32: UIImage] = [:]
public final class SparseNode: ASDisplayNode {
open class SparseNode: ASDisplayNode {
override public func hitTest(_ point: CGPoint, with event: UIEvent?) -> UIView? {
if self.alpha.isZero {
return nil

View File

@@ -1621,7 +1621,6 @@ open class TextView: UIView {
private class func calculateLayout(attributedString: NSAttributedString?, minimumNumberOfLines: Int, maximumNumberOfLines: Int, truncationType: CTLineTruncationType, backgroundColor: UIColor?, constrainedSize: CGSize, alignment: NSTextAlignment, verticalAlignment: TextVerticalAlignment, lineSpacingFactor: CGFloat, cutout: TextNodeCutout?, insets: UIEdgeInsets, lineColor: UIColor?, textShadowColor: UIColor?, textStroke: (UIColor, CGFloat)?, displaySpoilers: Bool) -> TextNodeLayout {
if let attributedString = attributedString {
let stringLength = attributedString.length
let font: CTFont