mirror of
https://github.com/TelegramMessenger/Telegram-iOS.git
synced 2026-07-05 19:28:46 +02:00
LinkHighlightingNode: ceil instead of floor for stair-step radii
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) <noreply@anthropic.com>
This commit is contained in:
parent
d1c5d66bd3
commit
b1aab0839c
1 changed files with 2 additions and 2 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue