# all files / Github/diagram-js/lib/features/grid-snapping/ GridUtil.js

100% Statements 4/4
100% Branches 2/2
100% Functions 1/1
100% Lines 4/4

    1
    2
    3
    4
    5
    6
    7
    8
    91×

    142×
    101×

    142×
     export var SPACING = 10;

    export function quantize(value, quantum, fn) {
      if (!fn) {
        fn = 'round';
      }

      return Math[ fn ](value / quantum) * quantum;
    }