Skip to content

Commit

Permalink
Revert rounding to calc
Browse files Browse the repository at this point in the history
  • Loading branch information
yuanchuan committed Sep 4, 2023
1 parent f9bd4d8 commit f6a1308
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/calc.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*/

import { last } from './utils/list.js';
import { is_invalid_number, round } from './utils/index.js';
import { is_invalid_number } from './utils/index.js';

const cache = new Map();

Expand Down Expand Up @@ -93,7 +93,7 @@ function calc(expr, context, repeat = []) {
}
}
}
return Number(round(stack[0])) || 0;
return Number(stack[0]) || 0;
}

function get_tokens(input) {
Expand Down
2 changes: 1 addition & 1 deletion src/generator/shapes.js
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ function create_polygon_points(option, fn) {
let angle = calc_angle(x, y, dx1, dy2, direction);
if (unit !== undefined && unit !== '%') {
if (unit !== 'none') {
x += round(x) + unit;
x = round(x) + unit;
y = round(y) + unit;
}
} else {
Expand Down

0 comments on commit f6a1308

Please sign in to comment.