function shrinkDimensionForStroke(desiredVisualSize, strokeWidth = 1) {
  return desiredVisualSize - strokeWidth;
}
function valueToY(value, minValue, maxValue, height, strokeWidth = 1) {
  const shrinkedHeight = shrinkDimensionForStroke(height, strokeWidth);
  const range = maxValue - minValue;
  const y = (-value + minValue) * shrinkedHeight / range + shrinkedHeight / 2;
  return y + strokeWidth / 2;
}
function valueToX(value, minValue, maxValue, width, strokeWidth = 1) {
  const shrinkedWidth = shrinkDimensionForStroke(width, strokeWidth);
  const range = maxValue - minValue;
  const x = (value - minValue) * shrinkedWidth / range;
  return x + strokeWidth / 2;
}
function adjustRectWidthForStroke(rectX, rectWidth, viewBoxMinX, viewBoxMaxX, strokeWidth = 1) {
  const halfStroke = strokeWidth / 2;
  let adjustedX = rectX;
  let shrinkedWidth = rectWidth;
  if (rectX === viewBoxMinX) {
    adjustedX = rectX + halfStroke;
    shrinkedWidth = rectWidth - halfStroke;
  }
  if (rectX + rectWidth === viewBoxMaxX) {
    shrinkedWidth = shrinkedWidth - halfStroke;
  }
  return { x: adjustedX, width: shrinkedWidth };
}
function adjustRectHeightForStroke(rectY, rectHeight, viewBoxMinY, viewBoxMaxY, strokeWidth = 1) {
  const halfStroke = strokeWidth / 2;
  let adjustedY = rectY;
  let shrinkedHeight = rectHeight;
  if (rectY === viewBoxMinY) {
    adjustedY = rectY + halfStroke;
    shrinkedHeight = rectHeight - halfStroke;
  }
  if (rectY + rectHeight === viewBoxMaxY) {
    shrinkedHeight = shrinkedHeight - halfStroke;
  }
  return { y: adjustedY, height: shrinkedHeight };
}
export {
  adjustRectHeightForStroke,
  adjustRectWidthForStroke,
  shrinkDimensionForStroke,
  valueToX,
  valueToY
};
//# sourceMappingURL=stroke-aware.js.map
