This commit is contained in:
Bachir Soussi Chiadmi 2023-09-11 10:11:02 +02:00
parent 8a5c57cd13
commit 8e9941c1d1

View File

@ -1393,7 +1393,7 @@ export default {
this.paper_main_object.scale(obj.s);
// update superposition constraints points
if (this.concernement.superposition_constraints_id.length) {
if (this.concernement.superposition_constraints_id && this.concernement.superposition_constraints_id.length) {
// get all the constraints of the world
let all_constrains = Matter.Composite.allConstraints(this.matterEngine.world);
// loop through all constraint ids recorded in the concernement
@ -1480,7 +1480,7 @@ export default {
this.paper_main_object.scale(obj.s);
// update superposition constraints points
if (this.concernement.superposition_constraints_id.length) {
if (this.concernement.superposition_constraints_id && this.concernement.superposition_constraints_id.length) {
// get all the constraints of the world
let all_constrains = Matter.Composite.allConstraints(this.matterEngine.world);
// loop through all constraint ids recorded in the concernement
@ -1536,7 +1536,10 @@ export default {
}
if (this.opened_concernement) {
if (this.opened_concernement.id !== this.id && this.opened_concernement.superposed_concernements_id.indexOf(this.id) < 0) {
if (
this.opened_concernement.id !== this.id
&& (!this.opened_concernement.superposed_concernements_id || this.opened_concernement.superposed_concernements_id.indexOf(this.id) < 0)
) {
this.pushAside()
}
} else if (this.map_mode === 'proximite'