Skip to content

Commit

Permalink
Fix custom truncation token last line width
Browse files Browse the repository at this point in the history
(cherry picked from commit eb22c98)
  • Loading branch information
Isaac committed Aug 2, 2024
1 parent eff4ad5 commit 4a44c61
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -494,6 +494,9 @@ public final class InteractiveTextNodeLayout: NSObject {
public var trailingLineWidth: CGFloat {
if let lastSegment = self.segments.last, let lastLine = lastSegment.lines.last {
var width = lastLine.frame.maxX
if let additionalTrailingLine = lastLine.additionalTrailingLine {
width += additionalTrailingLine.1
}

if let blockQuote = lastSegment.blockQuote {
if lastLine.frame.intersects(blockQuote.frame) {
Expand Down Expand Up @@ -1606,7 +1609,7 @@ open class InteractiveTextNode: ASDisplayNode, TextNodeProtocol, UIGestureRecogn
spoilerWords: [],
embeddedItems: [],
attachments: [],
additionalTrailingLine: (truncationToken, 0.0)
additionalTrailingLine: (truncationToken, truncationTokenWidth)
)
}
}
Expand Down

0 comments on commit 4a44c61

Please sign in to comment.