From 48484b87fa0cec21b4d6d64ea7ca431f3753694b Mon Sep 17 00:00:00 2001 From: Igor Solomennikov Date: Thu, 19 Feb 2026 12:05:30 -0800 Subject: [PATCH] Use CGPath to create rounded rect instead of UIBezierPath --- .../CellViews/CVWallpaperBlurView.swift | 2 ++ SignalUI/Appearance/BubbleConfiguration.swift | 27 +++++++------------ 2 files changed, 11 insertions(+), 18 deletions(-) diff --git a/Signal/ConversationView/CellViews/CVWallpaperBlurView.swift b/Signal/ConversationView/CellViews/CVWallpaperBlurView.swift index 6eae1f76f2..80d934cfcf 100644 --- a/Signal/ConversationView/CellViews/CVWallpaperBlurView.swift +++ b/Signal/ConversationView/CellViews/CVWallpaperBlurView.swift @@ -44,6 +44,8 @@ public class CVWallpaperBlurView: ManualLayoutViewWithLayer, CVDimmableView { } public func applyLayout() { + guard bounds.size.isNonEmpty, maskFrame.size.isNonEmpty else { return } + UIView.performWithoutAnimation { imageView.frame = imageViewFrame imageViewMaskLayer.frame = imageView.layer.bounds diff --git a/SignalUI/Appearance/BubbleConfiguration.swift b/SignalUI/Appearance/BubbleConfiguration.swift index db1d154708..5072c88a7b 100644 --- a/SignalUI/Appearance/BubbleConfiguration.swift +++ b/SignalUI/Appearance/BubbleConfiguration.swift @@ -145,8 +145,14 @@ public struct BubbleConfiguration { /// Designed to allow callers to configure masking layers that match bubble shape.. public func bubblePath(for rect: CGRect) -> UIBezierPath { switch corners.style { - case .uniform(let radius): - return UIBezierPath(roundedRect: rect, cornerRadius: radius) + case .uniform: + let cornerRadius = corners.radius(for: .topLeft, in: rect) + return UIBezierPath(cgPath: CGPath( + roundedRect: rect, + cornerWidth: cornerRadius, + cornerHeight: cornerRadius, + transform: nil, + )) case .segmented(let sharpCorners, let sharpCornerRadius, let wideCornerRadius): return UIBezierPath.roundedRect( @@ -169,21 +175,6 @@ public struct BubbleConfiguration { public func strokePath(for rect: CGRect) -> UIBezierPath? { guard stroke != nil else { return nil } - switch corners.style { - case .uniform(let radius): - return UIBezierPath(roundedRect: rect, cornerRadius: radius) - - case .segmented(let sharpCorners, let sharpCornerRadius, let wideCornerRadius): - return UIBezierPath.roundedRect( - rect, - sharpCorners: sharpCorners, - sharpCornerRadius: sharpCornerRadius, - wideCornerRadius: wideCornerRadius, - ) - - case .capsule: - let cornerRadius = corners.radius(for: .topLeft, in: rect) - return UIBezierPath(roundedRect: rect, cornerRadius: cornerRadius) - } + return bubblePath(for: rect) } }