Skip to content

Conversation

swhitty
Copy link
Owner

@swhitty swhitty commented Apr 13, 2025

SVGs with deep nested nodes (100+ deep) fail to parse and render when performed off main thread in Swift Concurrency.

This PR converts the recursive functions within the SwiftDraw to use iterative traversal within;

  • Parser when building DOM
  • LayerTree.Builder when building LayerTree
  • CommandGenerator when creating array of rendering commands

Fixes #72

Copy link

codecov bot commented Apr 13, 2025

Codecov Report

Attention: Patch coverage is 71.52778% with 41 lines in your changes missing coverage. Please review.

Project coverage is 83.66%. Comparing base (63a6201) to head (a69e747).

Files with missing lines Patch % Lines
SwiftDraw/LayerTree.Layer.swift 4.54% 21 Missing ⚠️
SwiftDraw/LayerTree.Builder.swift 73.80% 11 Missing ⚠️
SwiftDraw/LayerTree.CommandGenerator.swift 83.01% 9 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #76      +/-   ##
==========================================
- Coverage   83.89%   83.66%   -0.23%     
==========================================
  Files          82       82              
  Lines        7344     7384      +40     
==========================================
+ Hits         6161     6178      +17     
- Misses       1183     1206      +23     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@swhitty swhitty merged commit 7bf84f7 into main Apr 13, 2025
27 of 30 checks passed
@swhitty swhitty deleted the iterative-traversal branch April 13, 2025 06:55
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.

Hard crash while parsing Wikipedia SVG

1 participant