How to use the ve-range-utils.isPositionWithinRange function in ve-range-utils

To help you get started, we’ve selected a few ve-range-utils examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github TeselaGen / openVectorEditor / src / RowItem / Cutsites.js View on Github external
function getSnipForRow(
  snipPosition,
  row,
  sequenceLength,
  bpsPerRow,
  snipStyle,
  charWidth,
  index
) {
  if (!isPositionWithinRange(snipPosition, row)) return;
  let { xStart } = getXStartAndWidthOfRangeWrtRow(
    { start: snipPosition, end: snipPosition },
    row,
    bpsPerRow,
    charWidth,
    sequenceLength
  );

  let newCursorStyle = assign({}, snipStyle, {
    left: xStart + 2
  });
  let cursorEl = (
    <div style="{newCursorStyle}">
  );
  return cursorEl;
}</div>