Permalink
Browse files

restore if stack has one or more items

  • Loading branch information...
ugurk committed Feb 4, 2015
1 parent 1735174 commit 990f72085900d3a845a23562730daf3a119f4fb5
Showing with 4 additions and 2 deletions.
  1. +4 −2 silverlight/excanvas.js
View
@@ -688,8 +688,10 @@ if (!window.CanvasRenderingContext2D) {
};
contextPrototype.restore = function() {
- copyState(this.aStack_.pop(), this);
- setM(this, this.mStack_.pop());
+ if (this.aStack_.length) {
+ copyState(this.aStack_.pop(), this);
+ this.m_ = this.mStack_.pop();
+ }
};
contextPrototype.translate = function(aX, aY) {

0 comments on commit 990f720

Please sign in to comment.