added setStrokePaint() and setFillPaint() aliases for embedapi retro-compatibility

git-svn-id: http://svg-edit.googlecode.com/svn/trunk@2470 eee81c28-f429-11dd-99c0-75d572ba1ddd
master
Bruno Heridet 2013-02-25 13:05:25 +00:00
parent 2c1c5da6de
commit c3cc08655c
1 changed files with 19 additions and 56 deletions

View File

@ -5887,62 +5887,25 @@ this.setPaint = function(type, paint) {
// now set the current paint object // now set the current paint object
cur_properties[type + '_paint'] = p; cur_properties[type + '_paint'] = p;
switch (p.type) { switch (p.type) {
case "solidColor": case 'solidColor':
this.setColor(type, p.solidColor != "none" ? "#"+p.solidColor : "none"); this.setColor(type, p.solidColor != 'none' ? '#' + p.solidColor : 'none');
break; break;
case "linearGradient": case 'linearGradient':
case "radialGradient": case 'radialGradient':
canvas[type + 'Grad'] = p[p.type]; canvas[type + 'Grad'] = p[p.type];
setGradient(type); setGradient(type);
break; break;
default:
// console.log("none!");
} }
}; };
// alias
this.setStrokePaint = function(paint) {
this.setPaint('stroke', paint);
};
// this.setStrokePaint = function(p) { this.setFillPaint = function(paint) {
// // make a copy this.setPaint('fill', paint);
// var p = new $.jGraduate.Paint(p); };
// this.setStrokeOpacity(p.alpha/100);
//
// // now set the current paint object
// cur_properties.stroke_paint = p;
// switch ( p.type ) {
// case "solidColor":
// this.setColor('stroke', p.solidColor != "none" ? "#"+p.solidColor : "none");;
// break;
// case "linearGradient"
// case "radialGradient"
// canvas.strokeGrad = p[p.type];
// setGradient(type);
// default:
// // console.log("none!");
// }
// };
//
// this.setFillPaint = function(p, addGrad) {
// // make a copy
// var p = new $.jGraduate.Paint(p);
// this.setFillOpacity(p.alpha/100, true);
//
// // now set the current paint object
// cur_properties.fill_paint = p;
// if (p.type == "solidColor") {
// this.setColor('fill', p.solidColor != "none" ? "#"+p.solidColor : "none");
// }
// else if (p.type == "linearGradient") {
// canvas.fillGrad = p.linearGradient;
// if (addGrad) setGradient();
// }
// else if (p.type == "radialGradient") {
// canvas.fillGrad = p.radialGradient;
// if (addGrad) setGradient();
// }
// else {
// // console.log("none!");
// }
// };
// Function: getStrokeWidth // Function: getStrokeWidth
// Returns the current stroke-width value // Returns the current stroke-width value