blob: 9d3cc7f3b2b87b033f2fe81ccdf8fff90b97455a [file] [log] [blame]
function SVGFillFilter(filter, filterManager) {
this.filterManager = filterManager;
var feColorMatrix = createNS('feColorMatrix');
feColorMatrix.setAttribute('type', 'matrix');
feColorMatrix.setAttribute('color-interpolation-filters', 'sRGB');
feColorMatrix.setAttribute('values', '1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0');
filter.appendChild(feColorMatrix);
this.matrixFilter = feColorMatrix;
}
SVGFillFilter.prototype.renderFrame = function (forceRender) {
if(forceRender || this.filterManager._mdf) {
var color = this.filterManager.effectElements[2].p.v;
var opacity = this.filterManager.effectElements[6].p.v;
this.matrixFilter.setAttribute('values', '0 0 0 0 '+color[0]+' 0 0 0 0 '+color[1]+' 0 0 0 0 '+color[2]+' 0 0 0 '+opacity+' 0');
}
};