fix sketcher showing sketch for an outdated face

This commit is contained in:
Val Erastov 2019-02-15 19:36:31 -08:00
parent 58f2b1b117
commit 45de2e43fc
2 changed files with 10 additions and 1 deletions

View file

@ -48,7 +48,9 @@ export class InPlaceSketcher {
}
exit() {
this.face.ext.view.sketchGroup.visible = true;
if (this.face.ext.view) {
this.face.ext.view.sketchGroup.visible = true;
}
let viewer3d = this.ctx.services.viewer;
viewer3d.sceneSetup.trackballControls.removeEventListener( 'change', this.onCameraChange);
this.face = null;

View file

@ -123,6 +123,13 @@ export function activate(ctx) {
}
streams.craft.models.attach(updateAllSketches);
streams.craft.models.attach(() => {
if (inPlaceEditor.inEditMode) {
if (!inPlaceEditor.face.ext.view) {
inPlaceEditor.exit();
}
}
});
services.sketcher = {
sketchFace, sketchFace2D, updateAllSketches, getAllSketches, readSketch, hasSketch, inPlaceEditor, reassignSketch,