diff --git a/README.md b/README.md index ac61a5c..483a35e 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.12 + +* Fixed bug where pastes would get offset when canvas is panned + ### 0.4.11 * Copy and Paste, note that Paste in the menu may not work on some browsers because of security permissions, but standard keyboard shortcuts will work. diff --git a/js/globalfunctions.js b/js/globalfunctions.js index ae9ff5e..555110f 100644 --- a/js/globalfunctions.js +++ b/js/globalfunctions.js @@ -428,8 +428,8 @@ function loadActiveContainer(Elements) { logicEngine.MovingElement = new Array(logicEngine.ActiveContainer.Selected.length); for (let b = 0; b < logicEngine.ActiveContainer.Selected.length; b++) { - logicEngine.ActiveContainer.Selected[b].X = (logicEngine.ActiveContainer.Selected[b].X - lowestX) + logicEngine.Mouse.x - ((highestX-lowestX)/2); - logicEngine.ActiveContainer.Selected[b].Y = (logicEngine.ActiveContainer.Selected[b].Y - lowestY) + logicEngine.Mouse.y - ((highestY-lowestY)/2); + logicEngine.ActiveContainer.Selected[b].X = (logicEngine.ActiveContainer.Selected[b].X - lowestX) + (logicEngine.Mouse.x - logicEngine.Panning.OffsetX) - ((highestX-lowestX)/2); + logicEngine.ActiveContainer.Selected[b].Y = (logicEngine.ActiveContainer.Selected[b].Y - lowestY) + (logicEngine.Mouse.y - logicEngine.Panning.OffsetY) - ((highestY-lowestY)/2); logicEngine.MovingElement[b] = { StartX: logicEngine.ActiveContainer.Selected[b].X, StartY: logicEngine.ActiveContainer.Selected[b].Y diff --git a/js/main.js b/js/main.js index 1135198..b6006a9 100644 --- a/js/main.js +++ b/js/main.js @@ -2,7 +2,7 @@ MatCat BrowserLogic Simulator */ -let Version = "0.4.11"; +let Version = "0.4.12"; let spanVersion = document.getElementById("version"); spanVersion.innerText = Version;