refactor Use and Defs element with native code support(iOS)

This commit is contained in:
Horcrux
2016-07-19 23:09:51 +08:00
parent 4eddfc6885
commit dd6cb80e84
37 changed files with 535 additions and 282 deletions

View File

@@ -3,7 +3,7 @@ import _ from 'lodash';
const merge = _.assign;
function arrayDiffer(a, b) {
if (a == null || b == null) {
if (_.isNil(a) || _.isNil(b) ) {
return true;
}
if (a.length !== b.length) {
@@ -79,6 +79,10 @@ const GroupAttributes = merge(NodeAttributes, {
clipRule: true
});
const UseAttributes = merge(RenderableAttributes, {
href: true
});
const PathAttributes = merge(RenderableAttributes, {
d: {
diff: arrayDiffer
@@ -146,5 +150,6 @@ export {
EllipseAttributes,
ImageAttributes,
LineAttributes,
RectAttributes
RectAttributes,
UseAttributes
};