Skip to content

Commit

Permalink
fixed #1312
Browse files Browse the repository at this point in the history
fixed collision detection for non-integer devicePixelRatios
  • Loading branch information
jmoenig committed Jul 17, 2016
1 parent 8d0a7f1 commit 0974c75
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 6 deletions.
4 changes: 2 additions & 2 deletions gui.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ isRetinaSupported*/

// Global stuff ////////////////////////////////////////////////////////

modules.gui = '2016-July-15';
modules.gui = '2016-July-17';

// Declarations

Expand Down Expand Up @@ -2982,7 +2982,7 @@ IDE_Morph.prototype.aboutSnap = function () {
module, btn1, btn2, btn3, btn4, licenseBtn, translatorsBtn,
world = this.world();

aboutTxt = 'Snap! 4.0.8.1\nBuild Your Own Blocks\n\n'
aboutTxt = 'Snap! 4.0.8.2\nBuild Your Own Blocks\n\n'
+ 'Copyright \u24B8 2016 Jens M\u00F6nig and '
+ 'Brian Harvey\n'
+ '[email protected], [email protected]\n\n'
Expand Down
6 changes: 6 additions & 0 deletions history.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2965,3 +2965,9 @@ http://snap.berkeley.edu/run#cloud:Username=jens&ProjectName=rotation

== v4.0.8.1 ====

160717
------
* Morphic: fixed collision detection for non-integer devicePixelRatios

== v4.0.8.2 ====

12 changes: 8 additions & 4 deletions morphic.js
Original file line number Diff line number Diff line change
Expand Up @@ -1103,7 +1103,7 @@

/*global window, HTMLCanvasElement, FileReader, Audio, FileList*/

var morphicVersion = '2016-July-14';
var morphicVersion = '2016-July-17';
var modules = {}; // keep track of additional loaded modules
var useBlurredShadows = getBlurredShadowSupport(); // check for Chrome-bug

Expand Down Expand Up @@ -4114,9 +4114,13 @@ Morph.prototype.evaluateString = function (code) {

Morph.prototype.isTouching = function (otherMorph) {
var oImg = this.overlappingImage(otherMorph),
data = oImg.getContext('2d')
.getImageData(1, 1, oImg.width, oImg.height)
.data;
data;
if (!oImg.width || !oImg.height) {
return false;
}
data = oImg.getContext('2d')
.getImageData(1, 1, oImg.width, oImg.height)
.data;
return detect(
data,
function (each) {
Expand Down

0 comments on commit 0974c75

Please sign in to comment.