From f5113f539c5b224fdb9af8cde8e61f632dc7e49f Mon Sep 17 00:00:00 2001 From: daria2023 <95205482+daria2023@users.noreply.github.com> Date: Tue, 30 Jul 2024 20:04:26 +0800 Subject: [PATCH] fix: float image position boundary error #716 Co-authored-by: Hufe921 --- src/editor/core/position/Position.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/editor/core/position/Position.ts b/src/editor/core/position/Position.ts index dbe0783..85eebd2 100644 --- a/src/editor/core/position/Position.ts +++ b/src/editor/core/position/Position.ts @@ -643,6 +643,7 @@ export class Position { payload: IGetFloatPositionByXYPayload ): ICurrentPosition | void { const { x, y } = payload + const currentPageNo = payload.pageNo ?? this.draw.getPageNo() const currentZone = this.draw.getZone().getZone() for (let f = 0; f < this.floatPositionList.length; f++) { const { @@ -653,9 +654,11 @@ export class Position { trIndex, tdIndex, tdValueIndex, - zone: floatElementZone + zone: floatElementZone, + pageNo } = this.floatPositionList[f] if ( + currentPageNo === pageNo && element.type === ElementType.IMAGE && element.imgDisplay === payload.imgDisplay && (!floatElementZone || floatElementZone === currentZone)