mirror of
https://github.com/xibyte/jsketcher
synced 2025-12-24 09:26:43 +01:00
fix sketcher showing sketch for an outdated face
This commit is contained in:
parent
58f2b1b117
commit
45de2e43fc
2 changed files with 10 additions and 1 deletions
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Reference in a new issue