|
|
@ -142,10 +142,10 @@ export function pixFormat(pix, border) { |
|
|
|
if (!isNumber(pix)) { |
|
|
|
if (!isNumber(pix)) { |
|
|
|
return pix; |
|
|
|
return pix; |
|
|
|
} |
|
|
|
} |
|
|
|
if (pixUnit === "px") { |
|
|
|
if (BI.pixUnit === "px") { |
|
|
|
return (pix / pixRatio - (border || 0)) + pixUnit; |
|
|
|
return (pix / BI.pixRatio - (border || 0)) + BI.pixUnit; |
|
|
|
} |
|
|
|
} |
|
|
|
const length = pix / pixRatio + pixUnit; |
|
|
|
const length = pix / BI.pixRatio + BI.pixUnit; |
|
|
|
if (border > 0) { |
|
|
|
if (border > 0) { |
|
|
|
return `calc(${length} - ${`${border}px`})`; |
|
|
|
return `calc(${length} - ${`${border}px`})`; |
|
|
|
} |
|
|
|
} |
|
|
@ -157,11 +157,11 @@ export function toPix(pix, border) { |
|
|
|
if (!isNumber(pix)) { |
|
|
|
if (!isNumber(pix)) { |
|
|
|
return pix; |
|
|
|
return pix; |
|
|
|
} |
|
|
|
} |
|
|
|
if (pixUnit === "px") { |
|
|
|
if (BI.pixUnit === "px") { |
|
|
|
return pix - (border || 0) * pixRatio; |
|
|
|
return pix - (border || 0) * BI.pixRatio; |
|
|
|
} |
|
|
|
} |
|
|
|
if (border > 0) { |
|
|
|
if (border > 0) { |
|
|
|
return `calc(${pix / pixRatio + pixUnit} - ${`${border}px`})`; |
|
|
|
return `calc(${pix / BI.pixRatio + BI.pixUnit} - ${`${border}px`})`; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
return pix; |
|
|
|
return pix; |
|
|
|