Skip to content

Commit 45247d9

Browse files
authored
Fix ArchDetail.jcad annotations model + check exploded view (#724)
1 parent 529b533 commit 45247d9

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

examples/ArchDetail.jcad

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
{
22
"metadata": {
3-
"annotation_29c5280e-8625-4df2-912a-32aa90017552": "{\"position\":[-36.1767807258494,99.75043783365507,538.2064137258739],\"label\":\"New annotation\",\"contents\":[{\"value\":\"I don't like this window color, can you change it?\",\"user\":{\"username\":\"df6d8fe262c641fcafa07da7336acbad\",\"name\":\"Anonymous Erinome\",\"display_name\":\"Anonymous Erinome\",\"initials\":\"AE\",\"avatar_url\":null,\"color\":\"var(--jp-collaborator-color7)\"}}]}",
4-
"annotation_6f237b7c-d600-4d8d-a357-ad475c94ad93": "{\"position\":[-152.5901027396778,40.161167083635746,352],\"label\":\"New annotation\",\"contents\":[{\"value\":\"This floor is not wide enough\",\"user\":{\"username\":\"df6d8fe262c641fcafa07da7336acbad\",\"name\":\"Anonymous Erinome\",\"display_name\":\"Anonymous Erinome\",\"initials\":\"AE\",\"avatar_url\":null,\"color\":\"var(--jp-collaborator-color7)\"}}]}"
3+
"annotation_1a8070b9-1daa-49e1-a848-fd5b454bdae4": "{\"position\":[-130.26230074366637,30.671260581525274,0],\"label\":\"New annotation\",\"contents\":[{\"value\":\"The floor should be thicker\",\"user\":{\"username\":\"c5a9d7c1fc1441e5946c60296e623b1b\",\"name\":\"Anonymous Callirrhoe\",\"display_name\":\"Anonymous Callirrhoe\",\"initials\":\"AC\",\"avatar_url\":null,\"color\":\"var(--jp-collaborator-color7)\"}}],\"parent\":\"Structure014\"}"
54
},
65
"objects": [
76
{

packages/base/src/3dview/mainview.tsx

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ export class MainView extends React.Component<IProps, IStates> {
213213
);
214214

215215
// If in exploded view, we scale down to the initial position (to before exploding the view)
216-
if (this._explodedView.enabled) {
216+
if (this.explodedViewEnabled) {
217217
const explodedState = computeExplodedState({
218218
mesh: this._pointer3D.mesh,
219219
boundingGroup: this._boundingGroup,
@@ -714,7 +714,7 @@ export class MainView extends React.Component<IProps, IStates> {
714714
this._pointer3D.parent = picked.mesh;
715715

716716
// If in exploded view, we scale down to the initial position (to before exploding the view)
717-
if (this._explodedView.enabled) {
717+
if (this.explodedViewEnabled) {
718718
const explodedState = computeExplodedState({
719719
mesh: this._pointer3D.parent,
720720
boundingGroup: this._boundingGroup,
@@ -1440,7 +1440,7 @@ export class MainView extends React.Component<IProps, IStates> {
14401440
collaboratorPointer.mesh.visible = true;
14411441

14421442
// If we are in exploded view, we display the collaborator cursor at the exploded position
1443-
if (this._explodedView.enabled) {
1443+
if (this.explodedViewEnabled) {
14441444
const explodedState = computeExplodedState({
14451445
mesh: parent,
14461446
boundingGroup: this._boundingGroup,
@@ -1611,8 +1611,12 @@ export class MainView extends React.Component<IProps, IStates> {
16111611
}
16121612
}
16131613

1614+
get explodedViewEnabled(): boolean {
1615+
return this._explodedView.enabled && this._explodedView.factor !== 0;
1616+
}
1617+
16141618
private _setupExplodedView() {
1615-
if (this._explodedView.enabled) {
1619+
if (this.explodedViewEnabled) {
16161620
const center = new THREE.Vector3();
16171621
this._boundingGroup.getCenter(center);
16181622

@@ -1870,7 +1874,7 @@ export class MainView extends React.Component<IProps, IStates> {
18701874
);
18711875

18721876
// If in exploded view, we explode the annotation position as well
1873-
if (this._explodedView.enabled && parent) {
1877+
if (this.explodedViewEnabled && parent) {
18741878
const explodedState = computeExplodedState({
18751879
mesh: parent,
18761880
boundingGroup: this._boundingGroup,

0 commit comments

Comments
 (0)