Skip to content

Commit

Permalink
[convertEllipseToCircle] fix ellipse without radius
Browse files Browse the repository at this point in the history
Ref #1264
  • Loading branch information
TrySound committed Feb 20, 2021
1 parent ea82cc2 commit 7f4e052
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 2 additions & 2 deletions plugins/convertEllipseToCircle.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ exports.description = 'converts non-eccentric <ellipse>s to <circle>s';
*/
exports.fn = function(item) {
if (item.isElem('ellipse')) {
var rx = item.attr('rx').value || 0;
var ry = item.attr('ry').value || 0;
var rx = item.hasAttr('rx') && item.attr('rx').value || 0;
var ry = item.hasAttr('ry') && item.attr('ry').value || 0;

if (rx === ry ||
rx === 'auto' || ry === 'auto' // SVG2
Expand Down
2 changes: 2 additions & 0 deletions test/plugins/convertEllipseToCircle.01.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 7f4e052

Please sign in to comment.