Invert quote expand direction

This commit is contained in:
Isaac 2024-05-25 18:25:43 +04:00
parent ce84ce52b0
commit 47e9313621

View File

@ -110,6 +110,7 @@ public class ChatMessageTextBubbleContentNode: ChatMessageBubbleContentNode {
private var codeHighlightState: (id: EngineMessage.Id, specs: [CachedMessageSyntaxHighlight.Spec], disposable: Disposable)?
private var expandedBlockIds: Set<Int> = Set()
private var appliedExpandedBlockIds: Set<Int>?
private var displayContentsUnderSpoilers: Bool = false
override public var visibility: ListViewItemNodeVisibility {
@ -661,7 +662,7 @@ public class ChatMessageTextBubbleContentNode: ChatMessageBubbleContentNode {
boundingSize.height += topInset + bottomInset
return (boundingSize, { [weak self] animation, synchronousLoads, _ in
return (boundingSize, { [weak self] animation, synchronousLoads, itemApply in
if let strongSelf = self {
strongSelf.item = item
if let updatedCachedChatMessageText = updatedCachedChatMessageText {
@ -671,6 +672,11 @@ public class ChatMessageTextBubbleContentNode: ChatMessageBubbleContentNode {
strongSelf.textNode.textNode.displaysAsynchronously = !item.presentationData.isPreview
strongSelf.containerNode.frame = CGRect(origin: CGPoint(), size: boundingSize)
if strongSelf.appliedExpandedBlockIds != nil && strongSelf.appliedExpandedBlockIds != strongSelf.expandedBlockIds {
itemApply?.setInvertOffsetDirection()
}
strongSelf.appliedExpandedBlockIds = strongSelf.expandedBlockIds
let _ = textApply(InteractiveTextNodeWithEntities.Arguments(
context: item.context,
cache: item.controllerInteraction.presentationContext.animationCache,