Skip to content

Commit

Permalink
Fixed issues with Graphics failing to commit strokes / fills in certa…
Browse files Browse the repository at this point in the history
…in situations.

Signed-off-by: Grant Skinner <[email protected]>
  • Loading branch information
gskinner committed Sep 25, 2014
1 parent e3d9320 commit 2e99efa
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions src/easeljs/display/Graphics.js
Original file line number Diff line number Diff line change
Expand Up @@ -1203,16 +1203,18 @@ var G = Graphics;
**/
p._updateInstructions = function(commit) {
var instr = this._instructions, active = this._activeInstructions, commitIndex = this._commitIndex;
if (!this._dirty || !active.length) { return; }
this._dirty = false;

instr.length = commitIndex;
instr.push(Graphics.beginCmd);
instr.push.apply(instr, active);

if (this._fill) { instr.push(this._fill); }
if (this._stroke && this._strokeStyle) { instr.push(this._strokeStyle); }
if (this._stroke) { instr.push(this._stroke); }
if (this._dirty && active.length) {
instr.length = commitIndex; // remove old, uncommitted commands
instr.push(Graphics.beginCmd);
instr.push.apply(instr, active);

if (this._fill) { instr.push(this._fill); }
if (this._stroke && this._strokeStyle) { instr.push(this._strokeStyle); }
if (this._stroke) { instr.push(this._stroke); }

this._dirty = false;
}

if (commit) {
active.length = 0;
Expand Down

0 comments on commit 2e99efa

Please sign in to comment.