-
Notifications
You must be signed in to change notification settings - Fork 0
feat: loads svg from file into shape #98
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the ✨ Finishing Touches🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR transforms SVG texture handling by parsing SVG files and extracting shapes instead of treating them as image textures. The key changes involve replacing the texture-based SVG system with a shape-based vector rendering approach.
- Removes SVG texture caching and resizing infrastructure
- Adds SVG parsing to extract paths as shape data
- Refactors shape system to support multiple paths and improved structure
Reviewed Changes
Copilot reviewed 13 out of 15 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/textures.ts | Replaces SVG texture handling with shape parsing using svg-parser |
| src/parsePathData.ts | New file implementing SVG path data parsing and conversion to shape data |
| src/logic/shapes/shapes.zig | Major refactor to support multiple paths per shape with improved architecture |
| src/logic/shapes/paths.zig | New file implementing individual path handling within shapes |
| src/logic/svg_textures.zig | Removed - obsolete SVG texture management system |
| src/logic/shared.zig | New shared state for render scale access |
| src/logic/index.zig | Updated to use new shape system and removed SVG texture calls |
Comments suppressed due to low confidence (4)
src/textures.ts:68
- [nitpick] The variable name
svgRootNodeis misleading since it can be either a RootNode or null. Consider renaming tosvgRootNodeOrNullorparsedSvgto better reflect its nullable nature.
getImageWithDetails(url).then(([img, svgRootNode]) => {
src/parsePathData.ts:62
- Use strict equality
===instead of loose equality==for comparison.
}
src/logic/shapes/paths.zig:79
- [nitpick] The panic message should be more descriptive and include context about what the caller should do instead. Consider: "Cannot add point to closed path. Create a new path or reopen the existing path first."
@panic("Attempting to add point to already closed path!");
src/logic/shapes/shapes.zig:107
- [nitpick] The function name
addPointStartis unclear. Consider renaming toaddPointoraddPointToActivePathto better convey its purpose.
pub fn addPointStart(self: *Shape) !void {
No description provided.