Skip to content

Commit e1255b1

Browse files
committed
Fix custom class layout
1 parent 9058862 commit e1255b1

File tree

3 files changed

+9
-7
lines changed

3 files changed

+9
-7
lines changed

src/utils/extended-reality/view-objects/vr/detail-info-mesh.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
// @ts-ignore because three mesh ui's typescript support is not fully matured
2-
import ScrollUpButton from 'explorviz-frontend/src/utils/extended-reality/view-objects/vr/scroll-up-button';
3-
import ScrollDownButton from 'explorviz-frontend/src/utils/extended-reality/view-objects/vr/scroll-down-button';
4-
import OpenEntityButton from 'explorviz-frontend/src/utils/extended-reality/view-objects/vr/open-entity-button';
5-
import ThreeMeshUI from 'three-mesh-ui';
62
import DetailInfoScrollarea from 'explorviz-frontend/src/utils/extended-reality/view-objects/vr/detail-info-scrollarea';
3+
import OpenEntityButton from 'explorviz-frontend/src/utils/extended-reality/view-objects/vr/open-entity-button';
4+
import ScrollDownButton from 'explorviz-frontend/src/utils/extended-reality/view-objects/vr/scroll-down-button';
5+
import ScrollUpButton from 'explorviz-frontend/src/utils/extended-reality/view-objects/vr/scroll-up-button';
76
import * as THREE from 'three';
7+
import ThreeMeshUI from 'three-mesh-ui';
88

99
export default class DetailInfoMesh extends ThreeMeshUI.Block {
1010
/*implements IntersectableObject*/ sourceClass: string;

src/utils/layout/circle-layouter.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ let WIDTH_METRIC: string;
1313
let WIDTH_METRIC_MULTIPLIER: number;
1414
let DEPTH_METRIC: string;
1515
let DEPTH_METRIC_MULTIPLIER: number;
16-
16+
let COMPONENT_HEIGHT: number;
1717
/**
1818
* Sets the visualization settings needed for circle layout.
1919
* This should be called before using circle layout functions.
@@ -27,6 +27,7 @@ export function setCircleLayoutSettings() {
2727
DEPTH_METRIC_MULTIPLIER = vs.classDepthMultiplier.value;
2828
APP_LABEL_MARGIN = vs.appLabelMargin.value;
2929
APP_MARGIN = vs.appMargin.value;
30+
COMPONENT_HEIGHT = vs.openedComponentHeight.value;
3031
}
3132

3233
/**
@@ -94,7 +95,7 @@ export function applyCircleLayoutToClasses(
9495
classLayout.width = CLASS_FOOTPRINT;
9596
classLayout.depth = CLASS_FOOTPRINT;
9697
classLayout.height = CLASS_FOOTPRINT;
97-
classLayout.positionY = classLayout.height / 2.0; // Place directly on foundation
98+
classLayout.positionY = COMPONENT_HEIGHT * 2; // Place directly on foundation
9899

99100
// As Label and regular margin can differ, we offset by half the label margin difference
100101
const zMarginOffset = -APP_LABEL_MARGIN / 2 + APP_MARGIN / 2;

src/utils/layout/spiral-layouter.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ export function applySpiralLayoutToClasses(
9898
const { visualizationSettings: vs } = useUserSettingsStore.getState();
9999
const CLASS_FOOTPRINT = vs.classFootprint.value;
100100
const CLASS_MARGIN = vs.classMargin.value;
101+
const COMPONENT_HEIGHT = vs.openedComponentHeight.value;
101102
const APP_LABEL_MARGIN = vs.appLabelMargin.value;
102103
const APP_MARGIN = vs.appMargin.value;
103104
const SPIRAL_CENTER_OFFSET = vs.spiralCenterOffset.value;
@@ -177,7 +178,7 @@ export function applySpiralLayoutToClasses(
177178
classLayout.width = CLASS_FOOTPRINT;
178179
classLayout.depth = CLASS_FOOTPRINT;
179180
classLayout.height = CLASS_FOOTPRINT;
180-
classLayout.positionY = classLayout.height / 2.0; // Place directly on foundation
181+
classLayout.positionY = COMPONENT_HEIGHT * 2; // Place directly on foundation
181182

182183
// Calculate position based on current grid coordinates
183184
const classX = centerX + spiralState.x * spacing - CLASS_FOOTPRINT / 2;

0 commit comments

Comments
 (0)