Paint tool fixes

This commit is contained in:
Dennis Postma 2025-02-16 21:36:31 +01:00
parent bfb2bcb939
commit 0c61fe77de

View File

@ -117,7 +117,7 @@ const selectPencilOpen = ref(false)
const selectEraserOpen = ref(false)
const isContinuousDrawingEnabled = ref<Boolean>(false)
const isShowPlacedMapObjectPreviewEnabled = ref<Boolean>(mapEditor.isPlacedMapObjectPreviewEnabled.value)
const listOpen = computed(() => mapEditor.tool.value === 'pencil' && (mapEditor.drawMode.value === 'tile' || mapEditor.drawMode.value === 'map_object'))
const listOpen = computed(() => (mapEditor.tool.value === 'pencil' && (mapEditor.drawMode.value === 'tile' || mapEditor.drawMode.value === 'map_object')) || mapEditor.tool.value === 'paint')
// drawMode
function setDrawMode(value: string) {
@ -148,6 +148,7 @@ function handleModeClick(mode: string, type: 'pencil' | 'eraser') {
function handleClick(tool: string) {
mapEditor.setTool(tool)
if (tool === 'paint') mapEditor.setDrawMode('tile')
selectPencilOpen.value = tool === 'pencil' ? !selectPencilOpen.value : false
selectEraserOpen.value = tool === 'eraser' ? !selectEraserOpen.value : false
if (mapEditor.drawMode.value === 'teleport') emit('open-teleport')