This commit is contained in:
2026-09-10 04:22:41 +07:00
parent cc5c0e18c6
commit 4dab2e6c68
40 changed files with 47 additions and 47 deletions
+3 -3
View File
@@ -117,7 +117,7 @@ getGameMap()
async function saveMapItem(item: MapItem, hidden = item.hidden) {
mapSaving.value = true
try {
const res = await client.UpdateGameMapItem({ gameId: Number(gameId), kind: item.kind, itemId: item.itemId, x: item.x, y: item.y, hidden })
const res = await client.UpdateGameMapItem({ gameId: Number(gameId), kind: item.kind, itemId: item.itemId, x: Math.round(item.x || 0), y: Math.round(item.y || 0), hidden })
if (res.error != '') message.error(res.error || 'Не удалось сохранить координаты')
} finally {
mapSaving.value = false
@@ -138,8 +138,8 @@ function startMapDrag(item: MapItem, event: PointerEvent) {
function moveMapDrag(event: PointerEvent) {
if (!dragState) return
dragState.item.x = dragState.itemX + event.clientX - dragState.startX
dragState.item.y = dragState.itemY + event.clientY - dragState.startY
dragState.item.x = Math.round(dragState.itemX + event.clientX - dragState.startX)
dragState.item.y = Math.round(dragState.itemY + event.clientY - dragState.startY)
}
async function endMapDrag() {