mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-06-16 05:55:20 +00:00
Fix typing indicator
This commit is contained in:
parent
15f775ba50
commit
e564cfe618
@ -109,11 +109,13 @@ class ChatTypingActivityContentNode: ChatTitleActivityContentNode {
|
|||||||
}
|
}
|
||||||
|
|
||||||
override func updateLayout(_ constrainedSize: CGSize, alignment: NSTextAlignment) -> CGSize {
|
override func updateLayout(_ constrainedSize: CGSize, alignment: NSTextAlignment) -> CGSize {
|
||||||
let size = self.textNode.updateLayout(constrainedSize)
|
|
||||||
let indicatorSize = CGSize(width: 24.0, height: 16.0)
|
let indicatorSize = CGSize(width: 24.0, height: 16.0)
|
||||||
let originX: CGFloat
|
let size = self.textNode.updateLayout(CGSize(width: constrainedSize.width - indicatorSize.width, height: constrainedSize.height))
|
||||||
|
var originX: CGFloat
|
||||||
if case .center = alignment {
|
if case .center = alignment {
|
||||||
originX = floorToScreenPixels((indicatorSize.width - size.width) / 2.0)
|
originX = floorToScreenPixels((indicatorSize.width - size.width) / 2.0)
|
||||||
|
let overflowX = max(0.0, size.width + indicatorSize.width + 8.0 - constrainedSize.width)
|
||||||
|
originX = originX + overflowX
|
||||||
} else {
|
} else {
|
||||||
originX = indicatorSize.width
|
originX = indicatorSize.width
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user