Fix ArrayIndexOutOfBoundsException with compact SVG arc notation by hxrshxz · Pull Request #1282 · processing/processing4
Pull Request Overview
This PR fixes an ArrayIndexOutOfBoundsException that occurred when parsing SVG arc commands with compact notation where flags and coordinates are concatenated (e.g., a2 2 0 013 3). The fix adds support for detecting and properly parsing this compact format.
Key changes:
- Added
isCompactArcNotation()helper method to detect concatenated arc flags and coordinates - Modified arc parsing logic for both absolute (
A) and relative (a) commands to handle compact notation - Added comprehensive test coverage for various compact arc notation scenarios
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| core/src/processing/core/PShapeSVG.java | Implements compact arc notation detection and parsing logic |
| core/test/processing/core/PShapeSVGPathTest.java | Adds test cases for compact notation, standard notation, and edge cases |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.