From 3bcb9017a2d659626ce76ae23738e4c8f32839ba Mon Sep 17 00:00:00 2001 From: Ben Longo <11063448+benlongo@users.noreply.github.com> Date: Tue, 1 Aug 2023 21:11:43 -0400 Subject: [PATCH] Fix return type of graphic.clipRectByRect. --- src/util/graphic.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/util/graphic.ts b/src/util/graphic.ts index 70ad6d8b83..a7e26e1d98 100644 --- a/src/util/graphic.ts +++ b/src/util/graphic.ts @@ -446,7 +446,7 @@ export function clipPointsByRect(points: vector.VectorArray[], rect: ZRRectLike) /** * Return a new clipped rect. If rect size are negative, return undefined. */ -export function clipRectByRect(targetRect: ZRRectLike, rect: ZRRectLike): ZRRectLike { +export function clipRectByRect(targetRect: ZRRectLike, rect: ZRRectLike): ZRRectLike | undefined { const x = mathMax(targetRect.x, rect.x); const x2 = mathMin(targetRect.x + targetRect.width, rect.x + rect.width); const y = mathMax(targetRect.y, rect.y);