Skip to content

Commit

Permalink
fix(edit room from dialog): use correct coordinates when copying box (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
Junber authored Apr 4, 2022
1 parent ec2372a commit 94ec669
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/edit room from dialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -674,8 +674,8 @@ function copyBoxAt(mapId, targetId, x1, y1, x2, y2, copyRoomId, pasteXPos, paste
if (targetId === 'ANY' || bitsy.room[copyRoomId].tilemap[y][x] === targetId) {
copy.push({
map: 'TIL',
x: pasteXPos + x - 1,
y: pasteYPos + y - 1,
x: pasteXPos + x - leftPos,
y: pasteYPos + y - topPos,
id: bitsy.room[copyRoomId].tilemap[y][x],
});
}
Expand All @@ -689,8 +689,8 @@ function copyBoxAt(mapId, targetId, x1, y1, x2, y2, copyRoomId, pasteXPos, paste
if ((targetId === 'ANY' || targetId === item.id) && item.x === x && item.y === y) {
copy.push({
map: 'ITM',
x: pasteXPos + x - 1,
y: pasteYPos + y - 1,
x: pasteXPos + x - leftPos,
y: pasteYPos + y - topPos,
id: item.id,
});
}
Expand All @@ -706,8 +706,8 @@ function copyBoxAt(mapId, targetId, x1, y1, x2, y2, copyRoomId, pasteXPos, paste
} else if (spr.room === copyRoomId && spr.x === x && spr.y === y) {
copy.push({
map: 'SPR',
x: pasteXPos + x - 1,
y: pasteYPos + y - 1,
x: pasteXPos + x - leftPos,
y: pasteYPos + y - topPos,
id: spr.id,
});
}
Expand All @@ -716,8 +716,8 @@ function copyBoxAt(mapId, targetId, x1, y1, x2, y2, copyRoomId, pasteXPos, paste
if (bitsy.sprite[targetId] !== bitsy.playerId && bitsy.sprite[targetId].room === copyRoomId && bitsy.sprite[targetId].x === x && bitsy.sprite[targetId].y === y) {
copy.push({
map: 'SPR',
x: pasteXPos + x - 1,
y: pasteYPos + y - 1,
x: pasteXPos + x - leftPos,
y: pasteYPos + y - topPos,
id: bitsy.sprite[targetId].id,
});
}
Expand Down

0 comments on commit 94ec669

Please sign in to comment.