mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-24 02:12:17 +00:00
correct pinned widget detection => before it only accounted for 1x1 widgets
This commit is contained in:
@@ -527,22 +527,26 @@ export default {
|
||||
},
|
||||
checkPinnedWidgetAnimation() {
|
||||
let itemAtPosition = [];
|
||||
const itemCoord = {};
|
||||
switch (this.mode) {
|
||||
case MODE_RESIZE:
|
||||
for (let x = this.draggedItem.x; x <= this.x; x++) {
|
||||
for (let y = this.draggedItem.y; y <= this.y; y++) {
|
||||
this.items.forEach(item => {
|
||||
if (item.x == x && item.y == y) {
|
||||
itemAtPosition.push(item);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
itemCoord.x = this.draggedItem.x;
|
||||
itemCoord.y = this.draggedItem.y;
|
||||
itemCoord.w = this.x - this.draggedItem.x + 1;
|
||||
itemCoord.h = this.y - this.draggedItem.y + 1;
|
||||
break;
|
||||
case MODE_MOVE:
|
||||
itemAtPosition = this.items.filter(item=>item.x == this.x && item.y == this.y);
|
||||
itemCoord.x = this.x;
|
||||
itemCoord.y = this.y;
|
||||
itemCoord.w = this.draggedItem.w;
|
||||
itemCoord.h = this.draggedItem.h;
|
||||
break;
|
||||
}
|
||||
const frame = this.grid.getItemFrame(itemCoord);
|
||||
const itemsAtPosition = this.grid.getItemsInFrame(frame);
|
||||
const blockersAtPosition = itemsAtPosition.filter(index => this.indexedItems[index].pinned);
|
||||
|
||||
itemAtPosition = blockersAtPosition.map(index => this.indexedItems[index].data);
|
||||
|
||||
Array.from(document.getElementsByClassName("denied-dragging-animation"))?.forEach(ele => {
|
||||
ele.classList.remove("denied-dragging-animation");
|
||||
|
||||
Reference in New Issue
Block a user