0.4.12: Fixed mouse offset bug when canvas is panned after copying then pasting

This commit is contained in:
MatCat 2021-03-13 22:28:05 -08:00
parent d04fc3bb91
commit 3405cc2105
3 changed files with 7 additions and 3 deletions

View File

@ -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.

View File

@ -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

View File

@ -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;