From c64d2499d23095af16dabf79a84028add7104188 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=A2=B4=E7=94=B0=20=E4=BF=8A=E8=BC=94?= Date: Wed, 25 Feb 2015 15:13:07 +0900 Subject: [PATCH] Added some Text public properties for outline. --- src/easeljs/display/Text.js | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/easeljs/display/Text.js b/src/easeljs/display/Text.js index 9e9d5e0a7..7c7b0298f 100644 --- a/src/easeljs/display/Text.js +++ b/src/easeljs/display/Text.js @@ -145,6 +145,20 @@ this.createjs = this.createjs||{}; * @type Number **/ this.lineWidth = null; + + /** + * The type of corner created, when two lines meet. Any of "bevel", "round", and "miter". Default is "miter". + * @property lineJoin + * @type String + **/ + this.lineJoin = "miter"; + + /** + * The miter length is the distance between the inner corner and the outer corner where two lines meet. Default is 10. + * @property miterLimit + * @type Number + **/ + this.miterLimit = 10; } var p = createjs.extend(Text, createjs.DisplayObject); @@ -209,7 +223,7 @@ this.createjs = this.createjs||{}; if (this.DisplayObject_draw(ctx, ignoreCache)) { return true; } var col = this.color || "#000"; - if (this.outline) { ctx.strokeStyle = col; ctx.lineWidth = this.outline*1; } + if (this.outline) { ctx.strokeStyle = col; ctx.lineWidth = this.outline*1; ctx.miterLimit = this.miterLimit; ctx.lineJoin = this.lineJoin; } else { ctx.fillStyle = col; } this._drawText(this._prepContext(ctx));