-
Notifications
You must be signed in to change notification settings - Fork 87
#1502 Add snap to grid to sketch mode #7893
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 164 commits
d65eb43
a7cc802
7b6c5db
3f10524
181579e
8c99440
a0aa376
22ab0bb
6c5f503
a297ec2
32bf879
d26b4e0
dcf202e
fb56e74
98c8e25
5c8f7bf
c4c6cbc
bf25267
31f97b4
8759cd8
21ac79f
e688196
72accc5
db8372c
a1a4cc9
84cb1d7
2aea239
4ada50a
a17cc8b
1f9043f
25ead2c
cc5ba4a
88d5765
582cf91
54f9461
665c4c2
e12d6b2
60c4dd3
8763be4
804c46e
797b4d7
f8b05dc
d7eea35
8f0e092
278fe20
6b1c07f
6393d41
a4c376d
1ea8baa
7fa22f5
a39bad1
a770af9
887421e
c5f6a2e
a3be6f6
38464b9
42cff53
c1d18a0
a9923a0
6d9a934
9c169af
feef0d8
2f37393
7fe9f95
87fe7d0
3ef153e
137a416
feb8021
dd64f07
fc89237
de5982b
bd4ae29
e8e2d5c
b37210a
9b06d28
5f1292d
cefa7cd
f3fa5b6
9fe7147
1a38db3
37666d4
720d723
6e18816
0ae8e31
702bf65
4c777fb
5d47006
433ee48
e96334f
de6ae1c
81366f2
bfddd26
90800af
1e0ca35
697abca
dd19416
120ea64
77e47ee
f3f393e
e105db2
5111641
4f359e5
9d01490
2c170e0
06d1069
613dfb9
e1cc113
cc0f718
0a6714a
f12a606
b98db1e
5b65a7f
7384b6c
091c408
e7eb039
e9fcd5f
c02f295
88f9356
2022e7d
850fffb
aa710ca
380066a
8fd11f3
340af65
e487d67
7f5227d
bbb0c06
c5e12e5
5fbad61
319b379
44e3c0e
99e46bc
f7a4ada
38e3d4e
9dd0967
00237ea
d669634
726c4c1
832d4e1
900da94
f9958d5
5de0ccd
c62d77c
4e07547
7fb5897
401a257
cac9896
443a99d
1e50fa4
db30fe4
1afda7d
d34e78f
35dcef1
53f643a
2f630ec
adafab7
b0f737d
a20e28f
f1262d3
62b0a89
9f114c5
e00b483
0f267ea
6c56b73
312fadd
a54b9a8
8c0d90d
c6547ab
2b505d2
7f8a486
4c1cb93
98785be
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -64,7 +64,7 @@ pub struct Settings { | |||||
} | ||||||
|
||||||
/// Application wide settings. | ||||||
#[derive(Debug, Clone, Deserialize, Serialize, JsonSchema, ts_rs::TS, PartialEq, Validate)] | ||||||
#[derive(Debug, Default, Clone, Deserialize, Serialize, JsonSchema, ts_rs::TS, PartialEq, Validate)] | ||||||
#[ts(export)] | ||||||
#[serde(rename_all = "snake_case")] | ||||||
pub struct AppSettings { | ||||||
|
@@ -94,10 +94,6 @@ pub struct AppSettings { | |||||
/// of the app to aid in development. | ||||||
#[serde(default, skip_serializing_if = "is_default")] | ||||||
pub show_debug_panel: bool, | ||||||
/// If true, the grid cells will be fixed-size, where the width is your default length unit. | ||||||
/// If false, the grid will get larger as you zoom out, and smaller as you zoom in. | ||||||
#[serde(default = "make_it_so", skip_serializing_if = "is_true")] | ||||||
pub fixed_size_grid: bool, | ||||||
} | ||||||
|
||||||
/// Default to true. | ||||||
|
@@ -109,20 +105,6 @@ fn is_true(b: &bool) -> bool { | |||||
*b | ||||||
} | ||||||
|
||||||
impl Default for AppSettings { | ||||||
fn default() -> Self { | ||||||
Self { | ||||||
appearance: Default::default(), | ||||||
onboarding_status: Default::default(), | ||||||
dismiss_web_banner: Default::default(), | ||||||
stream_idle_mode: Default::default(), | ||||||
allow_orbit_in_sketch_mode: Default::default(), | ||||||
show_debug_panel: Default::default(), | ||||||
fixed_size_grid: make_it_so(), | ||||||
} | ||||||
} | ||||||
} | ||||||
|
||||||
fn deserialize_stream_idle_mode<'de, D>(deserializer: D) -> Result<Option<u32>, D::Error> | ||||||
where | ||||||
D: Deserializer<'de>, | ||||||
|
@@ -270,7 +252,7 @@ impl From<AppTheme> for kittycad::types::Color { | |||||
} | ||||||
|
||||||
/// Settings that affect the behavior while modeling. | ||||||
#[derive(Debug, Default, Clone, Deserialize, Serialize, JsonSchema, ts_rs::TS, PartialEq, Eq, Validate)] | ||||||
#[derive(Debug, Default, Clone, Deserialize, Serialize, JsonSchema, ts_rs::TS, PartialEq, Validate)] | ||||||
#[serde(rename_all = "snake_case")] | ||||||
#[ts(export)] | ||||||
pub struct ModelingSettings { | ||||||
|
@@ -301,6 +283,23 @@ pub struct ModelingSettings { | |||||
/// Whether or not to show a scale grid in the 3D modeling view | ||||||
#[serde(default, skip_serializing_if = "is_default")] | ||||||
pub show_scale_grid: bool, | ||||||
/// When enabled, the grid will use a fixed size based on your selected units rather than automatically scaling with zoom level. | ||||||
/// If true, the grid cells will be fixed-size, where the width is your default length unit. | ||||||
/// If false, the grid will get larger as you zoom out, and smaller as you zoom in. | ||||||
#[serde(default = "make_it_so", skip_serializing_if = "is_true")] | ||||||
pub fixed_size_grid: bool, | ||||||
/// Whether or not to snap to the scale grid in sketching mode. | ||||||
#[serde(default, skip_serializing_if = "is_default")] | ||||||
pub snap_to_grid: bool, | ||||||
/// The space between major grid lines, specified in the current unit | ||||||
#[serde(default, skip_serializing_if = "is_default")] | ||||||
pub major_grid_spacing: f64, | ||||||
/// Specifies ow many minor grid lines to have per major grid line. | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There's a typo in the field description for
Suggested change
Spotted by Diamond |
||||||
#[serde(default, skip_serializing_if = "is_default")] | ||||||
pub minor_grids_per_major: f64, | ||||||
/// The number of snaps to have between minor grid lines. 1 means snapping to the minor grid lines. | ||||||
#[serde(default, skip_serializing_if = "is_default")] | ||||||
pub snaps_per_minor: f64, | ||||||
} | ||||||
|
||||||
#[derive(Debug, Copy, Clone, Deserialize, Serialize, JsonSchema, ts_rs::TS, PartialEq, Eq)] | ||||||
|
@@ -681,6 +680,7 @@ text_wrapping = true"#; | |||||
base_unit: UnitLength::In, | ||||||
mouse_controls: MouseControlType::Zoo, | ||||||
camera_projection: CameraProjectionType::Perspective, | ||||||
fixed_size_grid: true, | ||||||
..Default::default() | ||||||
}, | ||||||
project: ProjectSettings { | ||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's a small typo in the documentation: "Specifies ow many minor grid lines" should be "Specifies how many minor grid lines". This affects the user-facing documentation and should be corrected for clarity.
Spotted by Diamond

Is this helpful? React 👍 or 👎 to let us know.