File tree Expand file tree Collapse file tree 1 file changed +3
-7
lines changed
editor/src/messages/portfolio/document/utility_types Expand file tree Collapse file tree 1 file changed +3
-7
lines changed Original file line number Diff line number Diff 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)
You can’t perform that action at this time.
0 commit comments