Skip to content

Commit

Permalink
fix: calc bug
Browse files Browse the repository at this point in the history
  • Loading branch information
CPPAlien committed Jun 22, 2021
1 parent eeb4f8a commit beb630d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion painter.js
Original file line number Diff line number Diff line change
Expand Up @@ -851,7 +851,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)/g, word => {
const afterOne = formula[1].replace(/([^\s\(\+\-\*\/]+)\.(left|right|bottom|top|width|height)/g, word => {
const [id, attr] = word.split('.');
return penCache.viewRect[id][attr];
});
Expand Down

0 comments on commit beb630d

Please sign in to comment.