Moving map objects restored
This commit is contained in:
parent
7daefb74eb
commit
5e11b67774
@ -24,7 +24,7 @@ const imageProps = computed(() => ({
|
||||
alpha: mapEditor.movingPlacedObject.value?.id == props.placedMapObject.id ? 0.5 : 1,
|
||||
tint: mapEditor.selectedPlacedObject.value?.id == props.placedMapObject.id ? 0x00ff00 : 0xffffff,
|
||||
depth: calculateIsometricDepth(props.placedMapObject.positionX, props.placedMapObject.positionY, props.placedMapObject.mapObject.frameWidth, props.placedMapObject.mapObject.frameHeight),
|
||||
...calculateObjectPlacement(props.placedMapObject,true),
|
||||
...calculateObjectPlacement(props.placedMapObject,false),
|
||||
flipX: props.placedMapObject.isRotated,
|
||||
texture: props.placedMapObject.mapObject.id,
|
||||
originX: props.placedMapObject.mapObject.originX,
|
||||
@ -35,6 +35,7 @@ function calculateObjectPlacement(mapObj: PlacedMapObject, tileCenterSnap: boole
|
||||
let position : {x: number; y: number}
|
||||
if (tileCenterSnap) {
|
||||
let halfTileWidth = config.tile_size.width/2
|
||||
let halfTileHeight = config.tile_size.height/2
|
||||
position = {
|
||||
x: Math.ceil((mapObj.positionX-config.tile_size.height)/halfTileWidth) * halfTileWidth,
|
||||
y: Math.ceil((mapObj.positionY-config.tile_size.height)/halfTileWidth) * halfTileWidth,
|
||||
|
@ -20,14 +20,14 @@ const props = defineProps<{
|
||||
const emit = defineEmits(['move', 'rotate', 'delete'])
|
||||
|
||||
const handleMove = () => {
|
||||
emit('move', props.placedMapObject.id)
|
||||
emit('move', props.placedMapObject.id, props.placedMapObject.map)
|
||||
}
|
||||
|
||||
const handleRotate = () => {
|
||||
emit('rotate', props.placedMapObject.id)
|
||||
emit('rotate', props.placedMapObject.id, props.placedMapObject.map)
|
||||
}
|
||||
|
||||
const handleDelete = () => {
|
||||
emit('delete', props.placedMapObject.id)
|
||||
emit('delete', props.placedMapObject.id, props.placedMapObject.map)
|
||||
}
|
||||
</script>
|
||||
|
Loading…
x
Reference in New Issue
Block a user