Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: fix the accuracy issue of number matching, closed #1488 #1504

Merged
merged 1 commit into from
Oct 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading