mirror of
https://github.com/TelegramMessenger/Telegram-iOS.git
synced 2026-07-06 03:33:41 +02:00
LinkHighlightingNode: fix X-edge snap unreachable after midY snap
In drawRectsImageContent's modern path the snap loop runs midY trimming first, leaving rects[i].maxY == rects[i+1].minY for adjacent line rects. The X-edge snap guard then evaluated rects[i].insetBy(dx: 0.0, dy: 1.0).intersects(rects[i+1]) — but positive dy shrinks the rect, so after the trim the guarded rectangle no longer intersects its neighbor (CGRect.intersects requires positive-area overlap). Flip dy to -1.0 so the temp rect grows and touching neighbors satisfy the guard. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
6e318f314e
commit
d1c5d66bd3
1 changed files with 1 additions and 1 deletions
|
|
@ -82,7 +82,7 @@ private func drawRectsImageContent(size: CGSize, context: CGContext, color: UICo
|
|||
rects[i + 1].size.height = rects[i + 1].maxY - midY
|
||||
hadChanges = true
|
||||
}
|
||||
if rects[i].maxY >= rects[i + 1].minY && rects[i].insetBy(dx: 0.0, dy: 1.0).intersects(rects[i + 1]) {
|
||||
if rects[i].maxY >= rects[i + 1].minY && rects[i].insetBy(dx: 0.0, dy: -1.0).intersects(rects[i + 1]) {
|
||||
if abs(rects[i].minX - rects[i + 1].minX) < minRadius {
|
||||
let commonMinX = min(rects[i].origin.x, rects[i + 1].origin.x)
|
||||
if rects[i].origin.x != commonMinX {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue