fixed duplicate def of globalAlpha in STYLES
This commit is contained in:
parent
efcdc56ccd
commit
f302a60389
@ -141,16 +141,10 @@
|
|||||||
apply : "stroke"
|
apply : "stroke"
|
||||||
},
|
},
|
||||||
"globalAlpha": {
|
"globalAlpha": {
|
||||||
svgAttr : "stroke-opacity",
|
svgAttr : "opacity",
|
||||||
canvas : 1,
|
canvas : 1,
|
||||||
svg : 1,
|
svg : 1,
|
||||||
apply : "stroke"
|
apply : "fill stroke"
|
||||||
},
|
|
||||||
"globalAlpha": {
|
|
||||||
svgAttr : "fill-opacity",
|
|
||||||
canvas : 1,
|
|
||||||
svg : 1,
|
|
||||||
apply : "fill"
|
|
||||||
},
|
},
|
||||||
"font":{
|
"font":{
|
||||||
//font converts to multiple svg attributes, there is custom logic for this
|
//font converts to multiple svg attributes, there is custom logic for this
|
||||||
@ -382,14 +376,16 @@
|
|||||||
}
|
}
|
||||||
this.__currentElement.setAttribute(style.svgAttr+"-opacity", opacity);
|
this.__currentElement.setAttribute(style.svgAttr+"-opacity", opacity);
|
||||||
} else {
|
} else {
|
||||||
|
var attr = style.svgAttr;
|
||||||
if (keys[i] === 'globalAlpha') {
|
if (keys[i] === 'globalAlpha') {
|
||||||
if (this.__currentElement.getAttribute(style.svgAttr)) {
|
attr = type+'-'+style.svgAttr;
|
||||||
|
if (this.__currentElement.getAttribute(attr)) {
|
||||||
//fill-opacity or stroke-opacity has already been set by stroke or fill.
|
//fill-opacity or stroke-opacity has already been set by stroke or fill.
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//otherwise only update attribute if right type, and not svg default
|
//otherwise only update attribute if right type, and not svg default
|
||||||
this.__currentElement.setAttribute(style.svgAttr, value);
|
this.__currentElement.setAttribute(attr, value);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user