lefengyang
2026-08-18 2d7d56003d4c5744d77954a840710508b7ca5eda
bugfix
1 files modified
4 ■■■■ changed files
ledApp/pages/addTemplate/addTemplate.vue 4 ●●●● patch | view | raw | blame | history
ledApp/pages/addTemplate/addTemplate.vue
@@ -592,14 +592,14 @@
            getCellByTouch(touch, cb) {
                this.getGridRect(rect => {
                    if (!rect) return
                    const x = touch.clientX - rect.left + this.scrollLeft
                    const x = touch.clientX + this.scrollLeft
                    const y = touch.clientY - rect.top
                    const colCount = this.width * (this.modeVal == 2 ? 10 : 1)
                    const cellWidth = rect.width / colCount
                    const cellHeight = rect.height / this.height
                    const colIndex = Math.floor(x / cellWidth)
                    const rowIndex = Math.floor(y / cellHeight)
                    console.log('colCount', colCount, 'rowIndex', rowIndex, 'colIndex', colIndex)
                    //console.log('colCount', colCount, 'rowIndex', rowIndex, 'colIndex', colIndex, x, cellWidth)
                    if (
                        colIndex >= 0 && colIndex < colCount &&
                        rowIndex >= 0 && rowIndex < this.height