From a5749a5ea26f1b1cac467069fddfb6f25cf1aec7 Mon Sep 17 00:00:00 2001 From: cgfhtw Date: Tue, 8 Nov 2022 14:47:44 +0100 Subject: [PATCH] bug: wrong check for empty fields when adding new widgets (coordinates are based on 0,0 not 1,1) --- public/js/components/Dashboard/Section.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/public/js/components/Dashboard/Section.js b/public/js/components/Dashboard/Section.js index 17689363a..250a26a7b 100644 --- a/public/js/components/Dashboard/Section.js +++ b/public/js/components/Dashboard/Section.js @@ -130,8 +130,8 @@ export default { if (evt.target != this.$refs.container || !this.editMode) return; const rect = this.containerRect; - const gridX = Math.floor(this.gridWidth * (evt.clientX - rect.left) / this.$refs.container.clientWidth) + 1; - const gridY = Math.floor(this.gridHeight * (evt.clientY - rect.top) / this.$refs.container.clientHeight) + 1; + const gridX = Math.floor(this.gridWidth * (evt.clientX - rect.left) / this.$refs.container.clientWidth); + const gridY = Math.floor(this.gridHeight * (evt.clientY - rect.top) / this.$refs.container.clientHeight); if (this.gridOccupiers[gridY * this.gridWidth + gridX] === undefined) { let widget = { widget: 1, config: {}, place: {}, custom: 1 }; widget.place[this.gridWidth] = {