Skip to content

Commit 0974c75

Browse files
committed
fixed #1312
fixed collision detection for non-integer devicePixelRatios
1 parent 8d0a7f1 commit 0974c75

File tree

3 files changed

+16
-6
lines changed

3 files changed

+16
-6
lines changed

gui.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ isRetinaSupported*/
7272

7373
// Global stuff ////////////////////////////////////////////////////////
7474

75-
modules.gui = '2016-July-15';
75+
modules.gui = '2016-July-17';
7676

7777
// Declarations
7878

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

2985-
aboutTxt = 'Snap! 4.0.8.1\nBuild Your Own Blocks\n\n'
2985+
aboutTxt = 'Snap! 4.0.8.2\nBuild Your Own Blocks\n\n'
29862986
+ 'Copyright \u24B8 2016 Jens M\u00F6nig and '
29872987
+ 'Brian Harvey\n'
29882988

history.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2965,3 +2965,9 @@ http://snap.berkeley.edu/run#cloud:Username=jens&ProjectName=rotation
29652965

29662966
== v4.0.8.1 ====
29672967

2968+
160717
2969+
------
2970+
* Morphic: fixed collision detection for non-integer devicePixelRatios
2971+
2972+
== v4.0.8.2 ====
2973+

morphic.js

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1103,7 +1103,7 @@
11031103

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

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

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

41154115
Morph.prototype.isTouching = function (otherMorph) {
41164116
var oImg = this.overlappingImage(otherMorph),
4117-
data = oImg.getContext('2d')
4118-
.getImageData(1, 1, oImg.width, oImg.height)
4119-
.data;
4117+
data;
4118+
if (!oImg.width || !oImg.height) {
4119+
return false;
4120+
}
4121+
data = oImg.getContext('2d')
4122+
.getImageData(1, 1, oImg.width, oImg.height)
4123+
.data;
41204124
return detect(
41214125
data,
41224126
function (each) {

0 commit comments

Comments
 (0)