Skip to content

Commit

Permalink
simplify cell size calc
Browse files Browse the repository at this point in the history
  • Loading branch information
sashankaryal committed May 22, 2024
1 parent b815e0c commit e9cb6fc
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions app/packages/looker-3d/src/fo3d/Gizmos.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,7 @@ export const Gizmos = () => {
const nominalCellSize = maxDim / 10;

// round to the nearest 10, but make sure it's at least 1
const roundedCellSize =
nominalCellSize <= 1 ? 1 : Math.ceil(nominalCellSize / 10) * 10;
const roundedCellSize = Math.max(1, Math.ceil(nominalCellSize / 10) * 10);
const roundedSectionSize = roundedCellSize * 10;

setCellSize(roundedCellSize);
Expand Down

0 comments on commit e9cb6fc

Please sign in to comment.