diff --git a/README.md b/README.md index 1cf1096..64f1913 100644 --- a/README.md +++ b/README.md @@ -14,6 +14,10 @@ LZ-String, Copyright 2013 pieroxy under MIT license https://github.com/pieroxy/l ## Changelog +### 0.4.9 + +* Fixed a bug where the JS engine would hang if attempting to place a new element when the visual work area is too full of elements. + ### 0.4.8 * Fixed bug where disconnects where not propagating properly diff --git a/js/globalfunctions.js b/js/globalfunctions.js index 426e5e7..c9b3e95 100644 --- a/js/globalfunctions.js +++ b/js/globalfunctions.js @@ -12,7 +12,9 @@ function addElement(RestoreData = null,refClass,props) { let height = newElement.Height; let noclearspot = true; - while (noclearspot) { + let findattempt = 0; + while (noclearspot && findattempt < 100) { + findattempt++; if (!logicEngine.ActiveContainer.checkOverlayBounds(x, y, width, height)) { noclearspot = false; } else { diff --git a/js/main.js b/js/main.js index 8c5f05a..db8e155 100644 --- a/js/main.js +++ b/js/main.js @@ -2,7 +2,7 @@ MatCat BrowserLogic Simulator */ -let Version = "0.4.8"; +let Version = "0.4.9"; let spanVersion = document.getElementById("version"); spanVersion.innerText = Version; // get the canvas and get the engine object going