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