Skip to content

Commit

Permalink
Merge pull request #179 from VisActor/fix/bounds-utils-type
Browse files Browse the repository at this point in the history
Fix/bounds utils type
  • Loading branch information
TingLittleKang authored Apr 26, 2024
2 parents 6bdff93 + 7986ce0 commit cb16f55
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"changes": [
{
"comment": "fix: fix params type of `calculateAnchorOfBounds()`\n\n",
"type": "none",
"packageName": "@visactor/vutils"
}
],
"packageName": "@visactor/vutils",
"email": "dingling112@gmail.com"
}
4 changes: 2 additions & 2 deletions packages/vutils/src/graphics/bounds-util.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { IBoundsLike } from '../data-structure';

export type InsideBoundsAnchorType = 'inside-top' | 'inside-bottom' | 'inside-left' | 'inside-right';
export type InsideBoundsAnchorType = 'inside' | 'inside-top' | 'inside-bottom' | 'inside-left' | 'inside-right';

export type BoundsAnchorType =
| 'top'
Expand All @@ -13,7 +13,7 @@ export type BoundsAnchorType =
| 'bottom-left'
| 'center';

export const calculateAnchorOfBounds = (bounds: IBoundsLike, anchorType: BoundsAnchorType | InsideBoundsAnchorType) => {
export const calculateAnchorOfBounds = (bounds: IBoundsLike, anchorType: string) => {
const { x1, x2, y1, y2 } = bounds;
const rectWidth = Math.abs(x2 - x1);
const rectHeight = Math.abs(y2 - y1);
Expand Down

0 comments on commit cb16f55

Please sign in to comment.