Skip to content

Commit

Permalink
fix: guard parameter does not match the type
Browse files Browse the repository at this point in the history
  • Loading branch information
cnyballk committed Jul 13, 2023
1 parent a6c4509 commit 9a99f82
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions packages/x6/src/graph/mousewheel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export class MouseWheel extends Base {
const guard = this.widgetOptions.guard

return (
(guard == null || guard.call(e)) &&
(guard == null || guard(e)) &&
ModifierKey.isMatch(e, this.widgetOptions.modifiers)
)
}
Expand All @@ -59,7 +59,7 @@ export class MouseWheel extends Base {
const guard = this.widgetOptions.guard

if (
(guard == null || guard.call(e)) &&
(guard == null || guard(e)) &&
ModifierKey.isMatch(e, this.widgetOptions.modifiers)
) {
const factor = this.widgetOptions.factor || 1.2
Expand Down
2 changes: 1 addition & 1 deletion sites/x6-sites/docs/api/graph/mousewheel.zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ interface MouseWheelOptions {
new Graph({
mousewheel: {
enabled: true,
guard(this: Graph, e: WheelEvent) {
guard(e: WheelEvent) {
if (e.altKey) {
// 当按下 alt 键时,忽略所有滚动事件
return false
Expand Down

0 comments on commit 9a99f82

Please sign in to comment.