Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added some Text public properties for outline. #571

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion src/easeljs/display/Text.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down Expand Up @@ -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));
Expand Down