Browse Source

Added Context2d#strokeText()

v1.x
Tj Holowaychuk 14 years ago
parent
commit
51e013abc0
  1. 16
      lib/canvas.js
  2. 2
      src/CanvasRenderingContext2d.cc

16
lib/canvas.js

@ -338,6 +338,22 @@ Context2d.prototype.setTransform = function(){
this.transform.apply(this, arguments);
};
/**
* Set text path then `stroke()`.
*
* @param {String} str
* @param {Number} x
* @param {Number} y
* @api public
*/
var strokeText = Context2d.prototype.strokeText;
Context2d.prototype.strokeText = function(str, x, y){
this.beginPath();
strokeText.call(this, str, x, y);
return this.stroke();
};
/**
* Set the fill style with the given css color string.
*

2
src/CanvasRenderingContext2d.cc

@ -866,7 +866,7 @@ Context2d::StrokeText(const Arguments &args) {
cairo_t *ctx = context->getContext();
cairo_text_extents_t te;
cairo_move_to(ctx, x, y);
cairo_show_text(ctx, *str);
cairo_text_path(ctx, *str);
return Undefined();
}

Loading…
Cancel
Save