Skip to content

Commit a9c7bd4

Browse files
committed
chore: tweak base height, font size, fix default values for inputs
1 parent 8e24a6a commit a9c7bd4

File tree

4 files changed

+9
-7
lines changed

4 files changed

+9
-7
lines changed

packages/app/src/components/sidebar_inputs/base_shape.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
import { Select } from "@mantine/core";
2-
import { useParametersContext } from "../../stores/parameters";
2+
import { getParametersStore, useParametersContext } from "../../stores/parameters";
33
import { SkylineBaseShape } from "../../three/types";
44
import { capitalize } from "../../utils";
55

66
export function BaseShapeInput() {
7+
const DEFAULT_VALUE = getParametersStore().getInitialState().inputs.shape;
78
const setInputs = useParametersContext((state) => state.setInputs);
89
return (
910
<Select
@@ -18,7 +19,7 @@ export function BaseShapeInput() {
1819
label: capitalize(SkylineBaseShape.Frustum),
1920
},
2021
]}
21-
defaultValue={SkylineBaseShape.Prism}
22+
defaultValue={DEFAULT_VALUE}
2223
allowDeselect={false}
2324
onChange={(value) => {
2425
if (value === null) {

packages/app/src/components/sidebar_inputs/export_format.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
import { Select } from "@mantine/core";
2-
import { useParametersContext } from "../../stores/parameters";
2+
import { getParametersStore, useParametersContext } from "../../stores/parameters";
33
import { ExportFormat } from "../../three/export";
44

55
export function ExportFormatInput() {
6+
const DEFAULT_VALUE = getParametersStore().getInitialState().inputs.exportFormat;
67
const setInputs = useParametersContext((state) => state.setInputs);
78
return (
89
<Select
@@ -17,7 +18,7 @@ export function ExportFormatInput() {
1718
label: ExportFormat.Stl.toUpperCase(),
1819
},
1920
]}
20-
defaultValue={ExportFormat.ThreeMF}
21+
defaultValue={DEFAULT_VALUE}
2122
allowDeselect={false}
2223
onChange={(value) => {
2324
if (value === null) {

packages/app/src/stores/parameters.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ export const getComputedParameters = (
6161
): SkylineModelComputedParameters => {
6262
const modelLength = WEEKS_IN_YEAR * inputs.towerSize;
6363
const modelWidth = DAYS_IN_WEEK * inputs.towerSize;
64-
const platformHeight = inputs.towerSize * 3;
64+
const platformHeight = inputs.towerSize * 3.2;
6565
const halfPlatformHeight = platformHeight / 2;
6666
const textSize = platformHeight / 2.2;
6767
const towerSizeOffset = inputs.towerSize / 2;

packages/app/src/three/skyline_base.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ export function SkylineBase({ years }: SkylineBaseProps) {
7171
points: toPolygons(
7272
ttfFont,
7373
computed.resolvedName,
74-
computed.platformHeight / 1.75,
74+
computed.platformHeight / 1.65,
7575
),
7676
offset: inputs.nameOffset,
7777
}),
@@ -83,7 +83,7 @@ export function SkylineBase({ years }: SkylineBaseProps) {
8383
points: toPolygons(
8484
ttfFont,
8585
computed.formattedYear,
86-
computed.platformHeight / 1.75,
86+
computed.platformHeight / 1.65,
8787
),
8888
offset: inputs.yearOffset,
8989
}),

0 commit comments

Comments
 (0)