"use strict";

exports.__esModule = true;
exports.doesLabelFitInAnnotation = void 0;
var _constants = require("./constants");
var _getXStartAndWidthOfRowAnnotation = require("./getXStartAndWidthOfRowAnnotation");
var doesLabelFitInAnnotation = function doesLabelFitInAnnotation(text, _ref, charWidth) {
  if (text === void 0) {
    text = "";
  }
  var range = _ref.range,
    width = _ref.width;
  var textLength = text.length * _constants.ANNOTATION_LABEL_FONT_WIDTH;
  var widthMinusOne = (range ? (0, _getXStartAndWidthOfRowAnnotation.getWidth)(range, charWidth, 0) : width) - charWidth;
  return widthMinusOne > textLength;
};

// export const getTruncatedLabel = (
//   text = "",
//   widthInBps,
// ) => {
//   const textLength = text.length * ANNOTATION_LABEL_FONT_WIDTH;
//   const widthMinusOne =
//     (range ? getWidth(range, charWidth, 0) : width) - charWidth;
//   const doesFit = widthMinusOne > textLength;
//   if (returnTextThatFits) {
//     if (doesFit) {
//       return text;
//     } else {
//       return text.slice(0, widthMinusOne);
//     }
//   } else {
//     return doesFit;
//   }
// };
exports.doesLabelFitInAnnotation = doesLabelFitInAnnotation;