Permalink
Browse files

do not split if only one group...

  • Loading branch information...
1 parent b1d1b3c commit db30e9aa1a23e674c1fd38f4b0f87dd4bd37030a @lautr3k committed Feb 6, 2016
Showing with 7 additions and 2 deletions.
  1. +1 −1 src/app/meshesmanager/module.js
  2. +6 −1 src/app/viewer3d/scripts/viewer3d.js
@@ -66,7 +66,7 @@ var AppMeshesmanager = GuiPanel.extend(
onMeshSelected: function(module, data) {
if (module !== this) {
var meshModel = this.model.getMeshByUuid(data.mesh.uuid);
- meshModel.selected(data.selected);
+ meshModel && meshModel.selected(data.selected);
}
}
});
@@ -1004,7 +1004,7 @@ var Viewer3d = JSClass(
var groups = this.groupFaces(mesh.geometry.faces, vertices);
// no group found
- if (! groups.length) {
+ if (groups.length < 2) {
return null;
}
@@ -1032,6 +1032,7 @@ var Viewer3d = JSClass(
]
});
}
+ this.selectedMeshes[uuid] = null;
this.addMesh(mesh.name + ' [' + gid + ']', faces);
}
this.removeMesh(uuid);
@@ -1044,6 +1045,10 @@ var Viewer3d = JSClass(
* @method removeMesh
*/
removeMesh: function(uuid) {
+ var mesh = this.getElement(uuid);
+ this.events.removeEventListener(mesh, 'dblclick', true);
+ this.selectedMeshes[uuid] = null;
+ delete this.selectedMeshes[uuid];
this.removeElement(uuid);
this.onMeshRemoved(uuid);
},

0 comments on commit db30e9a

Please sign in to comment.