Use 3 param method for converting r,g,b into css string.

This avoids creation of temporary arrays to pass them into the util
method. Also using "arguments" is more expensive then passing in 3
parameters.
This commit is contained in:
Fabian Lange 2014-10-27 21:30:47 +01:00
parent d65db7c5ed
commit ceffeab1de
6 changed files with 23 additions and 23 deletions

View file

@ -1551,12 +1551,12 @@ var CanvasGraphics = (function CanvasGraphicsClosure() {
this.current.fillColor = this.getColorN_Pattern(arguments);
},
setStrokeRGBColor: function CanvasGraphics_setStrokeRGBColor(r, g, b) {
var color = Util.makeCssRgb(arguments);
var color = Util.makeCssRgb(r, g, b);
this.ctx.strokeStyle = color;
this.current.strokeColor = color;
},
setFillRGBColor: function CanvasGraphics_setFillRGBColor(r, g, b) {
var color = Util.makeCssRgb(arguments);
var color = Util.makeCssRgb(r, g, b);
this.ctx.fillStyle = color;
this.current.fillColor = color;
},