Skip to content

Commit beb630d

Browse files
committed
fix: calc bug
1 parent eeb4f8a commit beb630d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

painter.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -851,7 +851,7 @@ function setStringPrototype(screenK, scale) {
851851
const formula = /^calc\((.+)\)$/.exec(this);
852852
if (formula && formula[1]) {
853853
// 进行 calc 计算
854-
const afterOne = formula[1].replace(/([^\s]+)\.(left|right|bottom|top|width|height)/g, word => {
854+
const afterOne = formula[1].replace(/([^\s\(\+\-\*\/]+)\.(left|right|bottom|top|width|height)/g, word => {
855855
const [id, attr] = word.split('.');
856856
return penCache.viewRect[id][attr];
857857
});

0 commit comments

Comments
 (0)