From 59a01c599b5f78d69d9b2bc81ab044d7e580a7a9 Mon Sep 17 00:00:00 2001 From: Samuel Newman Date: Mon, 20 Apr 2026 12:35:41 +0300 Subject: [PATCH] add comments, format, lint fix --- .../ios/ExpoBlueskyContextMenuView.swift | 4 ++++ modules/expo-bluesky-context-menu/ios/IconRenderer.swift | 1 - modules/expo-bluesky-context-menu/ios/SVGPathParser.swift | 5 +++-- src/components/icons/TEMPLATE.tsx | 7 +++++-- 4 files changed, 12 insertions(+), 5 deletions(-) diff --git a/modules/expo-bluesky-context-menu/ios/ExpoBlueskyContextMenuView.swift b/modules/expo-bluesky-context-menu/ios/ExpoBlueskyContextMenuView.swift index fbdb9bdac9..35b89f4838 100644 --- a/modules/expo-bluesky-context-menu/ios/ExpoBlueskyContextMenuView.swift +++ b/modules/expo-bluesky-context-menu/ios/ExpoBlueskyContextMenuView.swift @@ -22,6 +22,10 @@ class ExpoBlueskyContextMenuView: ExpoView, UIContextMenuInteractionDelegate { self.addInteraction(interaction) } + // RN layout can leave bounds at fractional-pixel values. The targeted preview + // snapshots this view's bounds for its return animation, and subpixel mismatches + // cause a visible glitch when the preview shrinks back into the thumbnail. + // Snapping to whole-pixel values prevents that. override var bounds: CGRect { get { let b = super.bounds diff --git a/modules/expo-bluesky-context-menu/ios/IconRenderer.swift b/modules/expo-bluesky-context-menu/ios/IconRenderer.swift index 94a0da893a..8200aca1a0 100644 --- a/modules/expo-bluesky-context-menu/ios/IconRenderer.swift +++ b/modules/expo-bluesky-context-menu/ios/IconRenderer.swift @@ -67,4 +67,3 @@ enum IconRenderer { return CGRect(x: parts[0], y: parts[1], width: parts[2], height: parts[3]) } } - diff --git a/modules/expo-bluesky-context-menu/ios/SVGPathParser.swift b/modules/expo-bluesky-context-menu/ios/SVGPathParser.swift index d8a346621d..70dad07725 100644 --- a/modules/expo-bluesky-context-menu/ios/SVGPathParser.swift +++ b/modules/expo-bluesky-context-menu/ios/SVGPathParser.swift @@ -2,14 +2,15 @@ import UIKit /// Minimal SVG path `d` parser. Handles the subset used by Bluesky's icon set: /// M m L l H h V v C c S s Q q T t A a Z z. +/// Assumes well-formed input from the app's own compiled-in icon paths. enum SVGPathParser { static func parse(_ d: String) -> UIBezierPath { let path = UIBezierPath() var tokens = Tokenizer(d) var currentPoint = CGPoint.zero var subpathStart = CGPoint.zero - var lastControl: CGPoint? = nil - var lastQuadControl: CGPoint? = nil + var lastControl: CGPoint? + var lastQuadControl: CGPoint? var command: Character = "M" while let next = tokens.peek() { diff --git a/src/components/icons/TEMPLATE.tsx b/src/components/icons/TEMPLATE.tsx index 18eb60145a..a7ef371cd1 100644 --- a/src/components/icons/TEMPLATE.tsx +++ b/src/components/icons/TEMPLATE.tsx @@ -1,4 +1,8 @@ -import {forwardRef, type ForwardRefExoticComponent, type RefAttributes} from 'react' +import { + forwardRef, + type ForwardRefExoticComponent, + type RefAttributes, +} from 'react' import Svg, {Path} from 'react-native-svg' import {type Props, useCommonSVGProps} from '#/components/icons/common' @@ -120,4 +124,3 @@ export function createMultiPathSVG({ Icon.svgStrokeWidth = 0 return Icon } -