simplified getPaint()
git-svn-id: http://svg-edit.googlecode.com/svn/trunk@2427 eee81c28-f429-11dd-99c0-75d572ba1ddd
This commit is contained in:
@@ -1356,27 +1356,19 @@
|
||||
|
||||
var getPaint = function(color, opac, type) {
|
||||
// update the editor's fill paint
|
||||
var opts = null;
|
||||
var opts = { alpha: opac };
|
||||
if (color.indexOf('url(#') === 0) {
|
||||
var refElem = svgCanvas.getRefElem(color);
|
||||
if (refElem) {
|
||||
refElem = refElem.cloneNode(true);
|
||||
} else {
|
||||
refElem = $('#' + type + '_color defs *')[0];
|
||||
refElem = $('#' + type + '_color defs *')[0];
|
||||
}
|
||||
|
||||
opts = { alpha: opac };
|
||||
opts[refElem.tagName] = refElem;
|
||||
} else if (color.indexOf('#') === 0) {
|
||||
opts = {
|
||||
alpha: opac,
|
||||
solidColor: color.substr(1)
|
||||
};
|
||||
opts.solidColor = color.substr(1);
|
||||
} else {
|
||||
opts = {
|
||||
alpha: opac,
|
||||
solidColor: 'none'
|
||||
};
|
||||
opts.solidColor = 'none';
|
||||
}
|
||||
return new $.jGraduate.Paint(opts);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user