-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #217 from VisActor/fix/obb-bounds-clone
fix: fix bug of `clone()` in obb
- Loading branch information
Showing
5 changed files
with
55 additions
and
38 deletions.
There are no files selected for viewing
11 changes: 11 additions & 0 deletions
11
common/changes/@visactor/vutils/fix-obb-bounds-clone_2024-12-20-09-03.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"changes": [ | ||
{ | ||
"comment": "fix: fix bug of `clone()` in obb\n\n", | ||
"type": "none", | ||
"packageName": "@visactor/vutils" | ||
} | ||
], | ||
"packageName": "@visactor/vutils", | ||
"email": "dingling112@gmail.com" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import { isPlainObject } from '../../src'; | ||
|
||
describe('isPlainObject', () => { | ||
it('isPlainObject({}) should be true', () => { | ||
expect(isPlainObject({})).toBeTruthy(); | ||
}); | ||
|
||
it('isPlainObject([1, 2, 3]) should be false', () => { | ||
expect(isPlainObject([1, 2, 3])).toBeFalsy(); | ||
}); | ||
|
||
it('isPlainObject(Function) should be false', () => { | ||
expect(isPlainObject(Function)).toBeFalsy(); | ||
}); | ||
|
||
it('isPlainObject(null) should be false', () => { | ||
expect(isPlainObject(null)).toBeFalsy(); | ||
}); | ||
|
||
it('isPlainObject(undefined) should be false', () => { | ||
expect(isPlainObject(undefined)).toBeFalsy(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { OBBBounds } from '../../src/index'; | ||
|
||
describe('OBBBounds', () => { | ||
it('clone of OBBBounds', () => { | ||
const a = new OBBBounds(); | ||
a.setValue(10, 10, 100, 100, Math.PI / 4); | ||
const b = a.clone(); | ||
|
||
expect(a.x1).toBe(b.x1); | ||
expect(a.x2).toBe(b.x2); | ||
expect(a.y1).toBe(b.y1); | ||
expect(a.y2).toBe(b.y2); | ||
expect(a.angle).toBe(b.angle); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters