hidden entite points are displayed without being accessible #2151 #2188

This commit is contained in:
2023-07-13 09:34:49 +02:00
parent 9e523af2ff
commit 7ef77fd71e
3 changed files with 24 additions and 11 deletions

View File

@@ -210,8 +210,9 @@ export default {
x: this.entites[i].display.ray * Math.cos(this.entites[i].display.alpha * (Math.PI/180)),
y: this.entites[i].display.ray * Math.sin(this.entites[i].display.alpha * (Math.PI/180))
}
this.entites_byid[entite.entite.id].display = this.entites[i].display;
if (entite.entite) {
this.entites_byid[entite.entite.id].display = this.entites[i].display;
}
}
},
getSalientPoints_OLD() {
@@ -557,12 +558,13 @@ export default {
});
for (let i = 0; i < this.entites.length; i++) {
// use paper symbol
let instance = new paper.SymbolItem(this.paper_symbol_definitions['entite']);
let symbol_name = this.entites[i].entite ? 'entite' : 'entite_hidden';
let instance = new paper.SymbolItem(this.paper_symbol_definitions[symbol_name]);
instance.name = 'entite';
instance.position = new paper.Point([this.pos.x + this.entites[i].display.pos.x, this.pos.y + this.entites[i].display.pos.y]);
instance.fillColor = '#000';
instance.item_id = this.entites[i].entite.id;
instance.item_type = 'entite';
instance.item_id = this.entites[i].entite ? this.entites[i].entite.id : null;
instance.item_type = this.entites[i].entite ? 'entite' : 'hidden_entite';
instance.is_symbol_instance = true;
g.addChild(instance)
}
@@ -574,7 +576,7 @@ export default {
name: 'agissantes'
});
for (let i = 0; i < this.entites.length; i++) {
if (this.entites[i].entite.agissante) {
if (this.entites[i].entite && this.entites[i].entite.agissante) {
let instance = new paper.SymbolItem(this.paper_symbol_definitions['entite_action']);
instance.name = 'entite_action';
instance.position = new paper.Point([this.pos.x + this.entites[i].display.pos.x, this.pos.y + this.entites[i].display.pos.y]);