Skip to content

Commit

Permalink
Merge pull request #483 from steptools/annotation-load-fix
Browse files Browse the repository at this point in the history
Annotation load fix
  • Loading branch information
funnymanpatrick authored Aug 12, 2016
2 parents ac56f6c + 5759927 commit dcdffbf
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ Bugfixes:
- Fixed a variety of bugs relating to controlling the mobile interface
- Don't show duplicate tolerances in tolerance view on sidebar
- Tools are no longer shown as enabled if they are not used in any active steps
- Annotations are properly hidden if loaded all at once

Version 1.7.1

Expand Down
16 changes: 13 additions & 3 deletions src/client/models/nc.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,10 +109,20 @@ export default class NC extends THREE.EventDispatcher {
obj.annotation3D.add(line);
});
});

let removeAnno = () => {
model.removeEventListener('annotationEndLoad', removeAnno);
_.each(model._addedGeometry, (line)=>{
obj.annotation3D.remove(line);
});
};

model.addEventListener("annotationMakeNonVisible", (event)=>{
_.each(model._addedGeometry, (line)=>{
obj.annotation3D.remove(line);
});
if (!model._addedGeometry || model._addedGeometry.length === 0) {
model.addEventListener('annotationEndLoad', removeAnno);
} else {
removeAnno();
}
});
}
}
Expand Down

0 comments on commit dcdffbf

Please sign in to comment.