diff options
| author | tonychenr <tonychenr@gmail.com> | 2014-10-13 22:45:56 -0700 |
|---|---|---|
| committer | tonychenr <tonychenr@gmail.com> | 2014-10-13 22:45:56 -0700 |
| commit | 93e926e63ab303baa0211257ab36109024e4e7da (patch) | |
| tree | 874127638703a5fc34de82c8a3c0dc0c73c37614 | |
| parent | f308c23824fcb48e25d2296ddc44a3ab4bcbef64 (diff) | |
| parent | 5f3279990be3478fde79b94f7dbd5d7da80df84b (diff) | |
| download | snap-93e926e63ab303baa0211257ab36109024e4e7da.tar.gz snap-93e926e63ab303baa0211257ab36109024e4e7da.zip | |
Merge remote-tracking branch 'origin/master' into slider_range_one
| -rwxr-xr-x | history.txt | 4 | ||||
| -rw-r--r-- | objects.js | 48 |
2 files changed, 34 insertions, 18 deletions
diff --git a/history.txt b/history.txt index 5999536..28116b9 100755 --- a/history.txt +++ b/history.txt @@ -2305,3 +2305,7 @@ ______ 141006 ------ * GUI, Objects: fixed #604. Thanks, @Gubolin! + +141008 +------ +* Objects: fixed #608, #610 @@ -125,7 +125,7 @@ PrototypeHatBlockMorph*/ // Global stuff //////////////////////////////////////////////////////// -modules.objects = '2014-October-06'; +modules.objects = '2014-October-08'; var SpriteMorph; var StageMorph; @@ -4378,25 +4378,37 @@ StageMorph.prototype.drawOn = function (aCanvas, aRect) { ); // pen trails - ws = Math.floor( - Math.min(w / this.scale, this.image.width * this.scale) - ); - hs = Math.floor( - Math.min(h / this.scale, this.image.height * this.scale) - ); + ws = w / this.scale; + hs = h / this.scale; context.save(); context.scale(this.scale, this.scale); - context.drawImage( - this.penTrails(), - src.left() / this.scale, - src.top() / this.scale, - ws, - hs, - area.left() / this.scale, - area.top() / this.scale, - ws, - hs - ); + try { + context.drawImage( + this.penTrails(), + src.left() / this.scale, + src.top() / this.scale, + ws, + hs, + area.left() / this.scale, + area.top() / this.scale, + ws, + hs + ); + } catch (err) { // sometimes triggered only by Firefox + // console.log(err); + context.restore(); + context.drawImage( + this.penTrails(), + 0, + 0, + this.dimensions.x, + this.dimensions.y, + this.left(), + this.top(), + this.dimensions.x * this.scale, + this.dimensions.y * this.scale + ); + } context.restore(); } }; |
