finish gradients refactor

This commit is contained in:
Horcrux
2016-07-20 22:38:45 +08:00
parent 18e1b60823
commit ff2395bcc2
64 changed files with 804 additions and 605 deletions

View File

@@ -55,10 +55,12 @@ const RenderableOnlyAttributes = {
fill: {
diff: arrayDiffer
},
fillOpacity: true,
fillRule: true,
stroke: {
diff: arrayDiffer
},
fillRule: true,
strokeOpacity: true,
strokeWidth: true,
strokeLinecap: true,
strokeLinejoin: true,
@@ -109,6 +111,30 @@ const ClipPathAttributes = {
name: true
};
const LinearGradientAttributes = merge({
x1: true,
y1: true,
x2: true,
y2: true,
gradient: {
diff: arrayDiffer
}
}, ClipPathAttributes);
const RadialGradientAttributes = merge({
fx: true,
fy: true,
rx: true,
ry: true,
cx: true,
cy: true,
r: true,
gradient: {
diff: arrayDiffer
}
}, ClipPathAttributes);
const CircleAttributes = merge({
cx: true,
cy: true,
@@ -146,7 +172,6 @@ const RectAttributes = merge({
ry: true
}, RenderableAttributes);
export {
PathAttributes,
TextAttributes,
@@ -158,5 +183,7 @@ export {
LineAttributes,
RectAttributes,
UseAttributes,
RenderableOnlyAttributes
RenderableOnlyAttributes,
LinearGradientAttributes,
RadialGradientAttributes
};