Skip to content

Commit 7732aca

Browse files
committed
scale if either goes below ten (for keavon)
1 parent 489ca95 commit 7732aca

File tree

1 file changed

+3
-7
lines changed
  • editor/src/messages/portfolio/document/utility_types

1 file changed

+3
-7
lines changed

editor/src/messages/portfolio/document/utility_types/misc.rs

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -249,16 +249,12 @@ impl GridSnapping {
249249
pub fn compute_rectangle_spacing(mut size: DVec2, major_interval: &UVec2, navigation: &PTZ) -> Option<DVec2> {
250250
let mut iterations = 0;
251251
size = size.abs();
252-
while (size.x * navigation.zoom() < 10.) || (size.y * navigation.zoom() < 10.) {
252+
while (size * navigation.zoom()).cmplt(DVec2::splat(10.)).any() {
253253
if iterations > 100 {
254254
return None;
255255
}
256-
if size.x * navigation.zoom() < 10. {
257-
size.x *= if major_interval.x != 1 { major_interval.x as f64 } else { 2. };
258-
}
259-
if size.y * navigation.zoom() < 10. {
260-
size.y *= if major_interval.y != 1 { major_interval.y as f64 } else { 2. };
261-
}
256+
size.x *= if major_interval.x != 1 { major_interval.x as f64 } else { 2. };
257+
size.y *= if major_interval.y != 1 { major_interval.y as f64 } else { 2. };
262258
iterations += 1;
263259
}
264260
Some(size)

0 commit comments

Comments
 (0)