diff --git a/src/utils/unit-conversion.js b/src/utils/unit-conversion.js index 35ab9c18..8695b797 100644 --- a/src/utils/unit-conversion.js +++ b/src/utils/unit-conversion.js @@ -4,25 +4,25 @@ export const pointRegex = /([\d.]+)pt/i; export const cmRegex = /([\d.]+)cm/i; export const inchRegex = /([\d.]+)in/i; -export const pixelToEMU = (pixelValue) => Math.round(pixelValue * 9525); +export const pixelToEMU = (pixelValue) => pixelValue * 9525; -export const EMUToPixel = (EMUValue) => Math.round(EMUValue / 9525); +export const EMUToPixel = (EMUValue) => EMUValue / 9525; -export const TWIPToEMU = (TWIPValue) => Math.round(TWIPValue * 635); +export const TWIPToEMU = (TWIPValue) => TWIPValue * 635; -export const EMUToTWIP = (EMUValue) => Math.round(EMUValue / 635); +export const EMUToTWIP = (EMUValue) => EMUValue / 635; -export const pointToTWIP = (pointValue) => Math.round(pointValue * 20); +export const pointToTWIP = (pointValue) => pointValue * 20; -export const TWIPToPoint = (TWIPValue) => Math.round(TWIPValue / 20); +export const TWIPToPoint = (TWIPValue) => TWIPValue / 20; -export const pointToHIP = (pointValue) => Math.round(pointValue * 2); +export const pointToHIP = (pointValue) => pointValue * 2; -export const HIPToPoint = (HIPValue) => Math.round(HIPValue / 2); +export const HIPToPoint = (HIPValue) => HIPValue / 2; -export const HIPToTWIP = (HIPValue) => Math.round(HIPValue * 10); +export const HIPToTWIP = (HIPValue) => HIPValue * 10; -export const TWIPToHIP = (TWIPValue) => Math.round(TWIPValue / 10); +export const TWIPToHIP = (TWIPValue) => TWIPValue / 10; export const pixelToTWIP = (pixelValue) => EMUToTWIP(pixelToEMU(pixelValue)); @@ -32,7 +32,7 @@ export const pixelToHIP = (pixelValue) => TWIPToHIP(EMUToTWIP(pixelToEMU(pixelVa export const HIPToPixel = (HIPValue) => EMUToPixel(TWIPToEMU(HIPToTWIP(HIPValue))); -export const inchToPoint = (inchValue) => Math.round(inchValue * 72); +export const inchToPoint = (inchValue) => inchValue * 72; export const inchToTWIP = (inchValue) => pointToTWIP(inchToPoint(inchValue)); @@ -44,9 +44,9 @@ export const pixelToPoint = (pixelValue) => HIPToPoint(pixelToHIP(pixelValue)); export const pointToPixel = (pointValue) => HIPToPixel(pointToHIP(pointValue)); -export const EIPToPoint = (EIPValue) => Math.round(EIPValue / 8); +export const EIPToPoint = (EIPValue) => EIPValue / 8; -export const pointToEIP = (PointValue) => Math.round(PointValue * 8); +export const pointToEIP = (PointValue) => PointValue * 8; export const pixelToEIP = (pixelValue) => pointToEIP(pixelToPoint(pixelValue));