Support stroke on image instances. Closes #536

This commit is contained in:
kangax 2013-04-04 12:52:05 +02:00
parent 4d037e979a
commit 6e725ae18b

View file

@ -113,6 +113,10 @@
this.clipTo && ctx.restore();
this._removeShadow(ctx);
if (this.stroke) {
this._stroke(ctx);
}
if (this.active && !noTransform) {
this.drawBorders(ctx);
this.drawControls(ctx);
@ -120,6 +124,18 @@
ctx.restore();
},
_stroke: function(ctx) {
ctx.save();
ctx.lineWidth = this.strokeWidth;
ctx.strokeStyle = this.stroke;
ctx.strokeRect(
-this.width / 2,
-this.height / 2,
this.width,
this.height);
ctx.restore();
},
/**
* Returns object representation of an instance
* @method toObject