modified superpositions to get only one superposition by mapitem
This commit is contained in:
@@ -94,16 +94,19 @@ export default {
|
||||
superposition_ids: [],
|
||||
clone: false,
|
||||
}
|
||||
// loop through superposistions couples
|
||||
// loop through all superposistions couples
|
||||
couple_ids.forEach(couple_id => {
|
||||
let cids = couple_id.match(/(\d+)-(\d+)/i);
|
||||
// console.log('cids', cids);
|
||||
if (concernement.id === parseInt(cids[1]) || concernement.id === parseInt(cids[2])) {
|
||||
let i = 0;
|
||||
// loop through all superpositions of couple
|
||||
for(let [superposition_id, superposition] of Object.entries(this.allSuperpositions_byid[couple_id])){
|
||||
i++;
|
||||
if (i === 1) {
|
||||
if (!mapitem.superposition_ids.length) {
|
||||
// if main map item does not yet have a superposition use it and alter his id (for matter constraints)
|
||||
mapitem.superposition_ids.push(superposition_id)
|
||||
mapitem.id = `${concernement.id}___${superposition_id}`
|
||||
}else{
|
||||
let mapitem_superposition = {
|
||||
id: `${concernement.id}___${superposition_id}`,
|
||||
|
||||
Reference in New Issue
Block a user