Coordinate grid uses same scale as user's units (#7465)
Closes https://github.com/KittyCAD/engine/issues/3494. Thanks to @nadr0 for helping on the JS side. If users set their units, the grid will stop auto scaling, and instead will be set to 10 of whatever unit they used. If users set their units, and those units are metric, then it'll include a scale bar (see screenshot). Imperial units won't have that bar. This behaviour is configurable via settings. ## Limitations - The scale bar below the grid cannot be disabled in metric units, and cannot be enabled in imperial units <img width="1690" alt="Screenshot 2025-06-05 at 7 51 41 PM" src="https://github.com/user-attachments/assets/c597087c-f96d-4c30-95f4-b3d8ba2b5567" />
Before Width: | Height: | Size: 33 KiB After Width: | Height: | Size: 32 KiB |
Before Width: | Height: | Size: 53 KiB After Width: | Height: | Size: 51 KiB |
Before Width: | Height: | Size: 50 KiB After Width: | Height: | Size: 49 KiB |
Before Width: | Height: | Size: 75 KiB After Width: | Height: | Size: 75 KiB |
Before Width: | Height: | Size: 48 KiB After Width: | Height: | Size: 48 KiB |
Before Width: | Height: | Size: 135 KiB After Width: | Height: | Size: 135 KiB |
Before Width: | Height: | Size: 118 KiB After Width: | Height: | Size: 118 KiB |
Before Width: | Height: | Size: 135 KiB After Width: | Height: | Size: 135 KiB |
Before Width: | Height: | Size: 67 KiB After Width: | Height: | Size: 67 KiB |
Before Width: | Height: | Size: 69 KiB After Width: | Height: | Size: 69 KiB |
Before Width: | Height: | Size: 69 KiB After Width: | Height: | Size: 69 KiB |
Before Width: | Height: | Size: 65 KiB After Width: | Height: | Size: 65 KiB |
@ -12,6 +12,7 @@ export const TEST_SETTINGS: DeepPartial<Settings> = {
|
||||
},
|
||||
onboarding_status: 'dismissed',
|
||||
show_debug_panel: true,
|
||||
fixed_size_grid: false,
|
||||
},
|
||||
modeling: {
|
||||
enable_ssao: false,
|
||||
|
@ -880,6 +880,10 @@ export async function setup(
|
||||
},
|
||||
...TEST_SETTINGS.project,
|
||||
onboarding_status: 'dismissed',
|
||||
// Tests were written before this setting existed.
|
||||
// It's true by default because it's a good user experience, but
|
||||
// these tests require it to be false.
|
||||
fixed_size_grid: false,
|
||||
},
|
||||
project: {
|
||||
...TEST_SETTINGS.project,
|
||||
|