Browse Source

Pull request #3433: KERNEL-14215 fix:index.html配置的BI.pixUnit和BI.pixRatio失效-bug48

Merge in VISUAL/fineui from ~VIVY.PAN/fineui:es6 to es6

* commit '92d96f9b7b7b841f859fa252c179e53f92e33dc8':
  KERNEL-14215 fix:index.html配置的BI.pixUnit和BI.pixRatio失效-bug48
es6
Vivy.Pan-潘柯芋 2 years ago
parent
commit
b010bcf710
  1. 12
      src/core/constant/var.js

12
src/core/constant/var.js

@ -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;

Loading…
Cancel
Save