We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Describe the bug Plugin removeOffCanvasPaths removes paths that are on canvas
removeOffCanvasPaths
To Reproduce Steps to reproduce the behavior:
const { optimize } = require('svgo'); console.log( optimize( '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-width="2" d="m12 12 7 7m-7-7L5 5m7 7-7 7m7-7 7-7"/></svg>', { plugins: ['removeOffCanvasPaths'] } ) );
Result:
{ data: '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"/>', info: { width: '24', height: '24' } }
Expected behavior Expected path to not be removed. Path is within canvas.
Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered:
Another, more simple path to reproduce the same issue:
const Svgo = require('svgo'); const { data } = Svgo.optimize( `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"> <path d="m10 5-5 5" stroke="#000"></path> </svg>`, { plugins: [`removeOffCanvasPaths`], } ); console.log(data);
As far as I could investigate, it fails this intersection check:
svgo/plugins/removeOffCanvasPaths.js
Line 131 in a9834ef
Sorry, something went wrong.
No branches or pull requests
Describe the bug
Plugin
removeOffCanvasPaths
removes paths that are on canvasTo Reproduce
Steps to reproduce the behavior:
Result:
Expected behavior
Expected path to not be removed. Path is within canvas.
Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered: