schnee effeckt und fehler Korektur
This commit is contained in:
42
node_modules/svgo/plugins/removeNonInheritableGroupAttrs.js
generated
vendored
42
node_modules/svgo/plugins/removeNonInheritableGroupAttrs.js
generated
vendored
@@ -1,14 +1,19 @@
|
||||
'use strict';
|
||||
|
||||
exports.name = 'removeNonInheritableGroupAttrs';
|
||||
|
||||
exports.type = 'perItem';
|
||||
|
||||
exports.active = true;
|
||||
|
||||
exports.description = 'removes non-inheritable group’s presentational attributes';
|
||||
exports.description =
|
||||
'removes non-inheritable group’s presentational attributes';
|
||||
|
||||
var inheritableAttrs = require('./_collections').inheritableAttrs,
|
||||
attrsGroups = require('./_collections').attrsGroups,
|
||||
excludedAttrs = ['display', 'opacity'];
|
||||
const {
|
||||
inheritableAttrs,
|
||||
attrsGroups,
|
||||
presentationNonInheritableGroupAttrs,
|
||||
} = require('./_collections');
|
||||
|
||||
/**
|
||||
* Remove non-inheritable group's "presentation" attributes.
|
||||
@@ -18,23 +23,16 @@ var inheritableAttrs = require('./_collections').inheritableAttrs,
|
||||
*
|
||||
* @author Kir Belevich
|
||||
*/
|
||||
exports.fn = function(item) {
|
||||
|
||||
if (item.isElem('g')) {
|
||||
|
||||
item.eachAttr(function(attr) {
|
||||
if (
|
||||
~attrsGroups.presentation.indexOf(attr.name) &&
|
||||
~attrsGroups.graphicalEvent.indexOf(attr.name) &&
|
||||
~attrsGroups.core.indexOf(attr.name) &&
|
||||
~attrsGroups.conditionalProcessing.indexOf(attr.name) &&
|
||||
!~excludedAttrs.indexOf(attr.name) &&
|
||||
!~inheritableAttrs.indexOf(attr.name)
|
||||
) {
|
||||
item.removeAttr(attr.name);
|
||||
}
|
||||
});
|
||||
|
||||
exports.fn = function (item) {
|
||||
if (item.type === 'element' && item.name === 'g') {
|
||||
for (const name of Object.keys(item.attributes)) {
|
||||
if (
|
||||
attrsGroups.presentation.includes(name) === true &&
|
||||
inheritableAttrs.includes(name) === false &&
|
||||
presentationNonInheritableGroupAttrs.includes(name) === false
|
||||
) {
|
||||
delete item.attributes[name];
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user