mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-03 21:16:35 +00:00
Fix attachment text input layout
This commit is contained in:
parent
2708aa0a41
commit
af0803b2ca
@ -634,14 +634,17 @@ public class AttachmentTextInputPanelNode: ASDisplayNode, TGCaptionPanelView, AS
|
||||
let fieldMaxHeight = textFieldMaxHeight(maxHeight, metrics: metrics)
|
||||
|
||||
var textFieldMinHeight: CGFloat = 35.0
|
||||
var textFieldRealInsets = UIEdgeInsets()
|
||||
if let presentationInterfaceState = self.presentationInterfaceState {
|
||||
textFieldMinHeight = calclulateTextFieldMinHeight(presentationInterfaceState, metrics: metrics)
|
||||
textFieldRealInsets = calculateTextFieldRealInsets(presentationInterfaceState)
|
||||
}
|
||||
|
||||
let textFieldHeight: CGFloat
|
||||
if let textInputNode = self.textInputNode {
|
||||
let maxTextWidth = width - textFieldInsets.left - textFieldInsets.right - self.textInputViewInternalInsets.left - self.textInputViewInternalInsets.right
|
||||
let measuredHeight = textInputNode.textHeightForWidth(maxTextWidth, rightInset: 0.0)
|
||||
|
||||
let measuredHeight = textInputNode.textHeightForWidth(maxTextWidth, rightInset: textFieldRealInsets.right)
|
||||
let unboundTextFieldHeight = max(textFieldMinHeight, ceil(measuredHeight))
|
||||
|
||||
let maxNumberOfLines = min(12, (Int(fieldMaxHeight - 11.0) - 33) / 22)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user