Browse Source

Replace makeCssRgb.apply in setStrokeColor and setFillColor

notmasteryet 13 years ago
parent
commit
1bb5592357
  1. 7
      src/canvas.js

7
src/canvas.js

@ -832,8 +832,8 @@ var CanvasGraphics = (function CanvasGraphicsClosure() {
}, },
setStrokeColor: function canvasGraphicsSetStrokeColor(/*...*/) { setStrokeColor: function canvasGraphicsSetStrokeColor(/*...*/) {
var cs = this.current.strokeColorSpace; var cs = this.current.strokeColorSpace;
var color = cs.getRgb(arguments); var rgbColor = cs.getRgb(arguments);
var color = Util.makeCssRgb.apply(null, cs.getRgb(arguments)); var color = Util.makeCssRgb(rgbColor[0], rgbColor[1], rgbColor[2]);
this.ctx.strokeStyle = color; this.ctx.strokeStyle = color;
this.current.strokeColor = color; this.current.strokeColor = color;
}, },
@ -870,7 +870,8 @@ var CanvasGraphics = (function CanvasGraphicsClosure() {
}, },
setFillColor: function canvasGraphicsSetFillColor(/*...*/) { setFillColor: function canvasGraphicsSetFillColor(/*...*/) {
var cs = this.current.fillColorSpace; var cs = this.current.fillColorSpace;
var color = Util.makeCssRgb.apply(null, cs.getRgb(arguments)); var rgbColor = cs.getRgb(arguments);
var color = Util.makeCssRgb(rgbColor[0], rgbColor[1], rgbColor[2]);
this.ctx.fillStyle = color; this.ctx.fillStyle = color;
this.current.fillColor = color; this.current.fillColor = color;
}, },

Loading…
Cancel
Save