From b1aab0839cc1f80b0865bafdea2fa578475524b4 Mon Sep 17 00:00:00 2001 From: isaac <> Date: Sat, 2 May 2026 11:46:38 +0200 Subject: [PATCH] LinkHighlightingNode: ceil instead of floor for stair-step radii MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit drawRectsImageContent's modern path computed nextRadius and prevRadius as min(outerRadius, floor(|Δx| * 0.5)). When |Δx| < 2 the floor produces 0 and the addArc call becomes a no-op, leaving an unsmoothed corner at the stair-step. Replace floor with ceil so any non-zero edge mismatch rounds up to at least 1 px. Exact-equality cases (Δx == 0) are unaffected — they take the else branch with a straight addLine. Co-Authored-By: Claude Opus 4.7 (1M context) --- submodules/Display/Source/LinkHighlightingNode.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/submodules/Display/Source/LinkHighlightingNode.swift b/submodules/Display/Source/LinkHighlightingNode.swift index dd2f57f3ae..c83203cbdf 100644 --- a/submodules/Display/Source/LinkHighlightingNode.swift +++ b/submodules/Display/Source/LinkHighlightingNode.swift @@ -124,7 +124,7 @@ private func drawRectsImageContent(size: CGSize, context: CGContext, color: UICo if rect.maxX == next.maxX { context.addLine(to: CGPoint(x: next.maxX, y: next.midY)) } else { - let nextRadius = min(outerRadius, floor(abs(rect.maxX - next.maxX) * 0.5)) + let nextRadius = min(outerRadius, ceil(abs(rect.maxX - next.maxX) * 0.5)) context.addLine(to: CGPoint(x: rect.maxX, y: rect.maxY - nextRadius)) if next.maxX > rect.maxX { context.addArc(tangent1End: CGPoint(x: rect.maxX, y: rect.maxY), tangent2End: CGPoint(x: rect.maxX + nextRadius, y: rect.maxY), radius: nextRadius) @@ -151,7 +151,7 @@ private func drawRectsImageContent(size: CGSize, context: CGContext, color: UICo if rect.minX == prev.minX { context.addLine(to: CGPoint(x: prev.minX, y: prev.midY)) } else { - let prevRadius = min(outerRadius, floor(abs(rect.minX - prev.minX) * 0.5)) + let prevRadius = min(outerRadius, ceil(abs(rect.minX - prev.minX) * 0.5)) context.addLine(to: CGPoint(x: rect.minX, y: rect.minY + prevRadius)) if rect.minX < prev.minX { context.addArc(tangent1End: CGPoint(x: rect.minX, y: rect.minY), tangent2End: CGPoint(x: rect.minX + prevRadius, y: rect.minY), radius: prevRadius)