fix: calc bug

This commit is contained in:
CPPAlien 2021-06-21 18:23:57 +08:00
parent 660da94ea3
commit 5c155bf66f

View File

@ -884,7 +884,7 @@ function setStringPrototype(screenK, scale) {
const formula = /^calc\((.+)\)$/.exec(this)
if (formula && formula[1]) {
// 进行 calc 计算
const afterOne = formula[1].replace(/([^\s]+)\.(left|right|bottom|top|width|height)/, (word) => {
const afterOne = formula[1].replace(/([^\s]+)\.(left|right|bottom|top|width|height)/g, (word) => {
const [id, attr] = word.split('.');
return relativeViewRect[id][attr]
}