From e532001ce56284d6935fe6f15c2c3aedfd3b13e3 Mon Sep 17 00:00:00 2001 From: Tj Holowaychuk Date: Thu, 30 Sep 2010 13:15:12 -0700 Subject: [PATCH] Added Context2d#createLinearGradient() --- lib/canvas.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/canvas.js b/lib/canvas.js index d013d2a..86b7843 100644 --- a/lib/canvas.js +++ b/lib/canvas.js @@ -119,11 +119,14 @@ Canvas.prototype.getContext = function(contextId){ } }; +Context2d.prototype.createLinearGradient = function(x0, y0, x1, y1){ + return new CanvasGradient(x0, y0, x1, y1); +}; + Context2d.prototype.createRadialGradient = function(x0, y0, r0, x1, y1, r1){ return new CanvasGradient(x0, y0, r0, x1, y1, r1); }; - /** * Set the fill style with the given css color string. *