generated from VLADIMIR/template_frontend
fix
This commit is contained in:
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user