added setStrokePaint() and setFillPaint() aliases for embedapi retro-compatibility
git-svn-id: http://svg-edit.googlecode.com/svn/trunk@2470 eee81c28-f429-11dd-99c0-75d572ba1dddmaster
parent
2c1c5da6de
commit
c3cc08655c
|
@ -5882,67 +5882,30 @@ function reorientGrads(elem, m) {
|
|||
this.setPaint = function(type, paint) {
|
||||
// make a copy
|
||||
var p = new $.jGraduate.Paint(paint);
|
||||
this.setPaintOpacity(type, p.alpha/100, true);
|
||||
this.setPaintOpacity(type, p.alpha / 100, true);
|
||||
|
||||
// now set the current paint object
|
||||
cur_properties[type + '_paint'] = p;
|
||||
switch ( p.type ) {
|
||||
case "solidColor":
|
||||
this.setColor(type, p.solidColor != "none" ? "#"+p.solidColor : "none");
|
||||
switch (p.type) {
|
||||
case 'solidColor':
|
||||
this.setColor(type, p.solidColor != 'none' ? '#' + p.solidColor : 'none');
|
||||
break;
|
||||
case "linearGradient":
|
||||
case "radialGradient":
|
||||
case 'linearGradient':
|
||||
case 'radialGradient':
|
||||
canvas[type + 'Grad'] = p[p.type];
|
||||
setGradient(type);
|
||||
break;
|
||||
default:
|
||||
// console.log("none!");
|
||||
}
|
||||
};
|
||||
|
||||
// alias
|
||||
this.setStrokePaint = function(paint) {
|
||||
this.setPaint('stroke', paint);
|
||||
};
|
||||
|
||||
// this.setStrokePaint = function(p) {
|
||||
// // make a copy
|
||||
// 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!");
|
||||
// }
|
||||
// };
|
||||
this.setFillPaint = function(paint) {
|
||||
this.setPaint('fill', paint);
|
||||
};
|
||||
|
||||
// Function: getStrokeWidth
|
||||
// Returns the current stroke-width value
|
||||
|
|
Loading…
Reference in New Issue