"use strict";
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
const units = require("./dist-es-value-types-numbers-units.cjs");
function pixelsToPercent(pixels, axis) {
  if (axis.max === axis.min)
    return 0;
  return pixels / (axis.max - axis.min) * 100;
}
const correctBorderRadius = {
  correct: (latest, node) => {
    if (!node.target)
      return latest;
    if (typeof latest === "string") {
      if (units.px.test(latest)) {
        latest = parseFloat(latest);
      } else {
        return latest;
      }
    }
    const x = pixelsToPercent(latest, node.target.x);
    const y = pixelsToPercent(latest, node.target.y);
    return `${x}% ${y}%`;
  }
};
exports.correctBorderRadius = correctBorderRadius;
exports.pixelsToPercent = pixelsToPercent;
//# sourceMappingURL=dist-es-projection-styles-scale-border-radius.cjs.map
