Skip to content

Commit

Permalink
bugfix
Browse files Browse the repository at this point in the history
  • Loading branch information
qkiroc committed Dec 20, 2024
1 parent 2647bc0 commit ed5b0c7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
5 changes: 5 additions & 0 deletions packages/amis-theme-editor-helper/rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,11 @@ const pkgs = [];
}
});

const index = pkgs.indexOf('style-inject');
if (~index) {
pkgs.splice(index, 1);
}

const external = id =>
pkgs.some(pkg => id.startsWith(pkg) || ~id.indexOf(`node_modules/${pkg}`));
const input = ['./src/index.ts'];
Expand Down
3 changes: 2 additions & 1 deletion packages/amis-ui/src/components/Shape.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,8 @@ class SvgPathGenerator {
getTrianglePath(radius: number) {
const S = this.size;
const height = Math.sin(this.toRadians(60)) * S;
const maxRadius = Math.min(radius, Math.tan(this.toRadians(30)) * (S / 2));
// 内切圆为最大圆角,其半径是高度的1/3
const maxRadius = Math.min(radius, height / 3) || 0;
// sin30度,所以斜边是R的2倍,斜边减去R就是高度移动的距离
const dy = (S - height - maxRadius) / 2;

Expand Down

0 comments on commit ed5b0c7

Please sign in to comment.