function checkDimensions(node, space) {
  if (node.w === 0 || node.h === 0) {
    return true;
  }

  if (space.width <= 0 || space.height <= 0) {
    return false;
  }

  const parent = node[$getParent]();
  const attempt = (node[$extra] && node[$extra].attempt) || 0;
  switch (parent.layout) {
    case "lr-tb":
    case "rl-tb":
      switch (attempt) {
        case 0: {
          let w, h;
          if (node.w !== "" || node.h !== "") {
            [, , w, h] = getTransformedBBox(node);
          }
          if (node.h !== "" && Math.round(h - space.height) > 1) {
            return false;
          }
          if (node.w !== "") {
            return Math.round(w - space.width) <= 1;
          }

          return node.minW <= space.width;
        }
        case 1: {
          if (node.h !== "" && !node[$isSplittable]()) {
            const [, , , h] = getTransformedBBox(node);
            if (Math.round(h - space.height) > 1) {
              return false;
            }
          }
          return true;
        }
        default:
          return true;
      }
    case "table":
    case "tb":
      if (attempt !== 1 && node.h !== "" && !node[$isSplittable]()) {
        const [, , , h] = getTransformedBBox(node);
        if (Math.round(h - space.height) > 1) {
          return false;
        }
      }
      return true;
    case "position":
      const [x, y, w, h] = getTransformedBBox(node);
      const isWidthOk = node.w === "" || Math.round(w + x - space.width) <= 1;
      const isHeightOk = node.h === "" || Math.round(h + y - space.height) <= 1;

      if (isWidthOk && isHeightOk) {
        return true;
      }

      const area = node[$getTemplateRoot]()[$extra].currentContentArea;
      if (isWidthOk) {
        return h + y > area.h;
      }

      return w + x > area.w;
    case "rl-row":
    case "row":
    default:
      // No layout, so accept everything.
      return true;
  }
}
/**
 * Returning true means that the node will be layed out
 * else the layout will go to its next step (changing of line
 * in case of lr-tb or changing content area...).
 */
Returning true means that the node will be layed out
else the layout will go to its next step (changing of line
in case of lr-tb or changing content area...).
Returning true means that the node will be layed out else the layout will go to its next step ( changing of line in case of lr - tb or changing content area ... ) .
function checkDimensions(node, space) {
  if (node.w === 0 || node.h === 0) {
    return true;
  }
  if (space.width <= 0 || space.height <= 0) {
    return false;
  }
  const parent = node[$getParent]();
  const attempt = (node[$extra] && node[$extra].attempt) || 0;
  switch (parent.layout) {
    case "lr-tb":
    case "rl-tb":
      switch (attempt) {
        case 0: {
          let w, h;
          if (node.w !== "" || node.h !== "") {
            [, , w, h] = getTransformedBBox(node);
          }
          if (node.h !== "" && Math.round(h - space.height) > 1) {
            return false;
          }
          if (node.w !== "") {
            return Math.round(w - space.width) <= 1;
          }
          return node.minW <= space.width;
        }
        case 1: {
          if (node.h !== "" && !node[$isSplittable]()) {
            const [, , , h] = getTransformedBBox(node);
            if (Math.round(h - space.height) > 1) {
              return false;
            }
          }
          return true;
        }
        default:
          return true;
      }
    case "table":
    case "tb":
      if (attempt !== 1 && node.h !== "" && !node[$isSplittable]()) {
        const [, , , h] = getTransformedBBox(node);
        if (Math.round(h - space.height) > 1) {
          return false;
        }
      }
      return true;
    case "position":
      const [x, y, w, h] = getTransformedBBox(node);
      const isWidthOk = node.w === "" || Math.round(w + x - space.width) <= 1;
      const isHeightOk = node.h === "" || Math.round(h + y - space.height) <= 1;
      if (isWidthOk && isHeightOk) {
        return true;
      }
      const area = node[$getTemplateRoot]()[$extra].currentContentArea;
      if (isWidthOk) {
        return h + y > area.h;
      }
      return w + x > area.w;
    case "rl-row":
    case "row":
    default:
      return true;
  }
}
function checkDimensions ( node , space ) { if ( node . w === 0 || node . h === 0 ) { return true ; } if ( space . width <= 0 || space . height <= 0 ) { return false ; } const parent = node [ $getParent ] ( ) ; const attempt = ( node [ $extra ] && node [ $extra ] . attempt ) || 0 ; switch ( parent . layout ) { case "lr-tb" : case "rl-tb" : switch ( attempt ) { case 0 : { let w , h ; if ( node . w !== "" || node . h !== "" ) { [ , , w , h ] = getTransformedBBox ( node ) ; } if ( node . h !== "" && Math . round ( h - space . height ) > 1 ) { return false ; } if ( node . w !== "" ) { return Math . round ( w - space . width ) <= 1 ; } return node . minW <= space . width ; } case 1 : { if ( node . h !== "" && ! node [ $isSplittable ] ( ) ) { const [ , , , h ] = getTransformedBBox ( node ) ; if ( Math . round ( h - space . height ) > 1 ) { return false ; } } return true ; } default : return true ; } case "table" : case "tb" : if ( attempt !== 1 && node . h !== "" && ! node [ $isSplittable ] ( ) ) { const [ , , , h ] = getTransformedBBox ( node ) ; if ( Math . round ( h - space . height ) > 1 ) { return false ; } } return true ; case "position" : const [ x , y , w , h ] = getTransformedBBox ( node ) ; const isWidthOk = node . w === "" || Math . round ( w + x - space . width ) <= 1 ; const isHeightOk = node . h === "" || Math . round ( h + y - space . height ) <= 1 ; if ( isWidthOk && isHeightOk ) { return true ; } const area = node [ $getTemplateRoot ] ( ) [ $extra ] . currentContentArea ; if ( isWidthOk ) { return h + y > area . h ; } return w + x > area . w ; case "rl-row" : case "row" : default : return true ; } }
Returning true means that the node will be layed out
 else the layout will go to its next step (changing of line
 in case of lr-tb or changing content area...).
Returning true means that the node will be layed out else the layout will go to its next step ( changing of line in case of lr - tb or changing content area ... ) .
// No layout, so accept everything.