mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-22 14:20:20 +00:00
[WIP] Business
This commit is contained in:
@@ -409,6 +409,8 @@ public final class TextNodeLayout: NSObject {
|
||||
switch self.resolvedAlignment {
|
||||
case .center:
|
||||
lineFrame = CGRect(origin: CGPoint(x: floor((size.width - line.frame.size.width) / 2.0), y: line.frame.minY), size: line.frame.size)
|
||||
case .right:
|
||||
lineFrame = CGRect(origin: CGPoint(x: size.width - line.frame.size.width, y: line.frame.minY), size: line.frame.size)
|
||||
default:
|
||||
lineFrame = displayLineFrame(frame: line.frame, isRTL: line.isRTL, boundingRect: CGRect(origin: CGPoint(), size: size), cutout: cutout)
|
||||
}
|
||||
@@ -521,6 +523,8 @@ public final class TextNodeLayout: NSObject {
|
||||
lineFrame.origin.x = floor((self.size.width - lineFrame.size.width) / 2.0)
|
||||
case .natural:
|
||||
lineFrame = displayLineFrame(frame: lineFrame, isRTL: line.isRTL, boundingRect: CGRect(origin: CGPoint(), size: self.size), cutout: self.cutout)
|
||||
case .right:
|
||||
lineFrame.origin.x = self.size.width - lineFrame.size.width
|
||||
default:
|
||||
break
|
||||
}
|
||||
@@ -589,6 +593,8 @@ public final class TextNodeLayout: NSObject {
|
||||
lineFrame.origin.x = floor((self.size.width - lineFrame.size.width) / 2.0)
|
||||
case .natural:
|
||||
lineFrame = displayLineFrame(frame: lineFrame, isRTL: line.isRTL, boundingRect: CGRect(origin: CGPoint(), size: self.size), cutout: self.cutout)
|
||||
case .right:
|
||||
lineFrame.origin.x = self.size.width - lineFrame.size.width
|
||||
default:
|
||||
break
|
||||
}
|
||||
@@ -666,6 +672,8 @@ public final class TextNodeLayout: NSObject {
|
||||
lineFrame.origin.x = floor((self.size.width - lineFrame.size.width) / 2.0)
|
||||
case .natural:
|
||||
lineFrame = displayLineFrame(frame: lineFrame, isRTL: line.isRTL, boundingRect: CGRect(origin: CGPoint(), size: self.size), cutout: self.cutout)
|
||||
case .right:
|
||||
lineFrame.origin.x = self.size.width - lineFrame.size.width
|
||||
default:
|
||||
break
|
||||
}
|
||||
@@ -846,6 +854,8 @@ public final class TextNodeLayout: NSObject {
|
||||
lineFrame.origin.x = floor((self.size.width - lineFrame.size.width) / 2.0)
|
||||
case .natural:
|
||||
lineFrame = displayLineFrame(frame: lineFrame, isRTL: line.isRTL, boundingRect: CGRect(origin: CGPoint(), size: self.size), cutout: self.cutout)
|
||||
case .right:
|
||||
lineFrame.origin.x = self.size.width - lineFrame.size.width
|
||||
default:
|
||||
break
|
||||
}
|
||||
@@ -2407,6 +2417,8 @@ open class TextNode: ASDisplayNode {
|
||||
} else {
|
||||
lineFrame.origin.x += offset.x
|
||||
}
|
||||
} else if alignment == .right {
|
||||
lineFrame.origin.x = offset.x + (bounds.size.width - lineFrame.width)
|
||||
}
|
||||
|
||||
//context.setStrokeColor(UIColor.red.cgColor)
|
||||
|
||||
Reference in New Issue
Block a user