Skip to content

refactor(scaling): inline hot paths, native safe area, encapsulation cleanup - #8

Merged
Dicky019 merged 1 commit into
mainfrom
refactor/scaling-perf-encapsulation
Jun 21, 2026
Merged

Dicky019 merged 1 commit into
mainfrom
refactor/scaling-perf-encapsulation

Conversation

@Dicky019

Copy link
Copy Markdown
Owner
  • perf: convert scalar Numeric scaling directly to CGFloat (drop the cgFloatValue dynamic-cast bridge from the scalar path) and mark the scalar + FastScale paths @inlinable so consumers inline them cross-module
  • fix: batch integer bridge uses full-range CGFloat(v) (was trapping above Int.max); guard measurePerformance against zero iterations
  • refactor(metrics): keep ScreenUtil's safe-area accessors and ScreenMetrics fields, but source the values from the native window at snapshot rebuild and store them as raw CGFloats on Snapshot. The SafeAreaInsets wrapper struct is removed. nativeSafeArea() is hardened: foreground-active scene, keyWindow, watchOS/tvOS platform guards
  • refactor(core): derive Snapshot.default from platform defaults; internalize ScreenDimensions
  • docs: correct CLAUDE.md Module Map Internal/ rows

No public safe-area signature changes; 108 tests pass; builds clean under Swift 6 strict concurrency.

…cleanup

- perf: convert scalar Numeric scaling directly to CGFloat (drop the
  cgFloatValue dynamic-cast bridge from the scalar path) and mark the
  scalar + FastScale paths @inlinable so consumers inline them cross-module
- fix: batch integer bridge uses full-range CGFloat(v) (was trapping above
  Int.max); guard measurePerformance against zero iterations
- refactor(metrics): keep ScreenUtil's safe-area accessors and
  ScreenMetrics fields, but source the values from the native window at
  snapshot rebuild and store them as raw CGFloats on Snapshot. The
  SafeAreaInsets wrapper struct is removed. nativeSafeArea() is hardened:
  foreground-active scene, keyWindow, watchOS/tvOS platform guards
- refactor(core): derive Snapshot.default from platform defaults;
  internalize ScreenDimensions
- docs: correct CLAUDE.md Module Map Internal/ rows

No public safe-area signature changes; 108 tests pass; builds clean under
Swift 6 strict concurrency.
@Dicky019
Dicky019 merged commit 0a711bc into main Jun 21, 2026
4 checks passed
@Dicky019
Dicky019 deleted the refactor/scaling-perf-encapsulation branch June 21, 2026 16:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant