Skip to content

Commit

Permalink
fix: fix the accuracy issue of number matching, closed #1488
Browse files Browse the repository at this point in the history
  • Loading branch information
neuqzxy authored and xile611 committed Oct 24, 2024
1 parent 2a51b68 commit 54f33f6
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "@visactor/vrender-core",
"comment": "fix: fix the accuracy issue of number matching, closed #1488",
"type": "none"
}
],
"packageName": "@visactor/vrender-core"
}
6 changes: 3 additions & 3 deletions packages/vrender-core/src/core/window.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { inject, injectable } from '../common/inversify-lite';
import type { IPointLike } from '@visactor/vutils';
import { Matrix, type IBoundsLike, type IMatrix, IBounds, Point } from '@visactor/vutils';
import { Matrix, type IBoundsLike, type IMatrix, IBounds, Point, isEqual, isNumberClose } from '@visactor/vutils';
import { Generator } from '../common/generator';
import type {
ICanvas,
Expand Down Expand Up @@ -234,8 +234,8 @@ export class DefaultWindow implements IWindow {
return !(
viewBox.x1 === 0 &&
viewBox.y1 === 0 &&
this.width === viewBox.width() &&
this.height === viewBox.height()
isNumberClose(this.width, viewBox.width()) &&
isNumberClose(this.height, viewBox.height())
);
}

Expand Down

0 comments on commit 54f33f6

Please sign in to comment.