|
@@ -326,14 +326,20 @@ export default {
|
|
},
|
|
},
|
|
draggable(object_id, value) {
|
|
draggable(object_id, value) {
|
|
if (!this.objects.has(object_id)) return;
|
|
if (!this.objects.has(object_id)) return;
|
|
- if (value) this.draggable_objects.push(this.objects.get(object_id));
|
|
|
|
- else this.draggable_objects.pop(this.objects.get(object_id));
|
|
|
|
|
|
+ const object = this.objects.get(object_id);
|
|
|
|
+ if (value) this.draggable_objects.push(object);
|
|
|
|
+ else {
|
|
|
|
+ const index = this.draggable_objects.indexOf(object);
|
|
|
|
+ if (index != -1) this.draggable_objects.splice(index, 1);
|
|
|
|
+ }
|
|
},
|
|
},
|
|
delete(object_id) {
|
|
delete(object_id) {
|
|
if (!this.objects.has(object_id)) return;
|
|
if (!this.objects.has(object_id)) return;
|
|
- this.objects.get(object_id).removeFromParent();
|
|
|
|
|
|
+ const object = this.objects.get(object_id);
|
|
|
|
+ object.removeFromParent();
|
|
this.objects.delete(object_id);
|
|
this.objects.delete(object_id);
|
|
- this.draggable_objects.pop(this.objects.get(object_id));
|
|
|
|
|
|
+ const index = this.draggable_objects.indexOf(object);
|
|
|
|
+ if (index != -1) this.draggable_objects.splice(index, 1);
|
|
},
|
|
},
|
|
set_texture_url(object_id, url) {
|
|
set_texture_url(object_id, url) {
|
|
if (!this.objects.has(object_id)) return;
|
|
if (!this.objects.has(object_id)) return;
|