Skip to content

Commit

Permalink
fix: change the boundary condition for adjacent rects in isRectInView…
Browse files Browse the repository at this point in the history
…port
  • Loading branch information
fand committed Jul 23, 2024
1 parent 91d0d2e commit 05f53cf
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions packages/vfx-js/src/vfx-player.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,31 +126,31 @@ describe("isRectInViewport", () => {
pad(0),
0,
),
).toBe(true);
).toBe(false);
expect(
isRectInViewport(
rect(0, 0, 1, 1),
rect(1, 0, 1, 1), // right
pad(0),
0,
),
).toBe(true);
).toBe(false);
expect(
isRectInViewport(
rect(0, 0, 1, 1),
rect(0, -1, 1, 1), // top
pad(0),
0,
),
).toBe(true);
).toBe(false);
expect(
isRectInViewport(
rect(0, 0, 1, 1),
rect(0, 1, 1, 1), // bottom
pad(0),
0,
),
).toBe(true);
).toBe(false);

// distant rects
expect(
Expand Down Expand Up @@ -234,31 +234,31 @@ describe("isRectInViewport", () => {
pad(1),
0,
),
).toBe(true);
).toBe(false);
expect(
isRectInViewport(
rect(0, 0, 1, 1),
rect(2, 0, 1, 1), // 1px right
pad(1),
0,
),
).toBe(true);
).toBe(false);
expect(
isRectInViewport(
rect(0, 0, 1, 1),
rect(0, -2, 1, 1), // 1px top
pad(1),
0,
),
).toBe(true);
).toBe(false);
expect(
isRectInViewport(
rect(0, 0, 1, 1),
rect(0, 2, 1, 1), // 1px bottom
pad(1),
0,
),
).toBe(true);
).toBe(false);

// more distant rects
expect(
Expand Down

0 comments on commit 05f53cf

Please sign in to comment.