!some(!true) is the same as every(true) and we don't need to check for the originalFrame since only the moving item was in there and no other item hence no occupier

This commit is contained in:
chfhtw
2026-04-16 16:00:01 +02:00
parent 5b5f6ac0b9
commit 992cb6b310
+2 -1
View File
@@ -120,7 +120,8 @@ class GridLogic {
// checks if target contains widget with the same high and width
let occupiersData = occupiers.map(occupier => this.data[occupier]);
let occupiersFrame = occupiersData.map(occupier => occupier.frame).flat();
if (!occupiersFrame.some(frame => !currItem.frame.includes(frame)) && !occupiersFrame.some(frame => originalFrame.includes(frame))){
if (occupiersFrame.every(frame => currItem.frame.includes(frame))) {
// every slot of all items in the target zone is inside said zone
let replaceUpdate = [];
let newOccupierFrames = [];
for(let f of originalFrame){