Adjusted selectedplacedmapobject toolbar, close list when eraser selected

This commit is contained in:
Colin Kallemein 2025-02-09 20:59:03 +01:00
parent b8b985470f
commit 44b0368276
2 changed files with 4 additions and 4 deletions

View File

@ -1,6 +1,6 @@
<template> <template>
<div class="flex flex-col items-center px-5 fixed bottom-24 left-0 z-20"> <div class="flex flex-col items-center px-5 py-1 fixed bottom-20 left-0 z-20">
<div class="toolbar rounded flex bg-gray solid border-solid border-2 border-gray-500 text-gray-300 p-1.5 px-3 h-10 space-x-2"> <div class="flex h-10 gap-2">
<button @mousedown.stop @click="handleDelete" class="btn-red !py-3 px-4"> <button @mousedown.stop @click="handleDelete" class="btn-red !py-3 px-4">
<img src="/assets/icons/trashcan.svg" class="w-4 h-4" alt="Delete" /> <img src="/assets/icons/trashcan.svg" class="w-4 h-4" alt="Delete" />
</button> </button>

View File

@ -116,7 +116,7 @@ const listOpen = ref(false)
// drawMode // drawMode
function setDrawMode(value: string) { function setDrawMode(value: string) {
if (mapEditor.tool.value === 'paint' || mapEditor.tool.value === 'pencil' || mapEditor.tool.value === 'eraser') { if (mapEditor.tool.value === 'paint' || mapEditor.tool.value === 'pencil') {
listOpen.value = false listOpen.value = false
emit('close-lists') emit('close-lists')
if (value === 'tile' || value === 'map_object') { if (value === 'tile' || value === 'map_object') {
@ -160,7 +160,7 @@ function handleClick(tool: string) {
listOpen.value = false listOpen.value = false
emit('open-settings') emit('open-settings')
emit('close-lists') emit('close-lists')
} else if (tool === 'move') { } else if (tool === 'move' || tool === 'eraser') {
listOpen.value = false listOpen.value = false
emit('close-lists') emit('close-lists')
mapEditor.setTool(tool) mapEditor.setTool(tool)