From c249b9eec215fe573b325d1430212f5f01c32099 Mon Sep 17 00:00:00 2001 From: Hufe921 Date: Sun, 18 Aug 2024 18:23:31 +0800 Subject: [PATCH] fix: float image position when scaling the page #766 --- src/editor/core/draw/Draw.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/editor/core/draw/Draw.ts b/src/editor/core/draw/Draw.ts index 833d3d1..fb3387c 100644 --- a/src/editor/core/draw/Draw.ts +++ b/src/editor/core/draw/Draw.ts @@ -2183,6 +2183,7 @@ export class Draw { ctx: CanvasRenderingContext2D, payload: IDrawFloatPayload ) { + const { scale } = this.options const floatPositionList = this.position.getFloatPositionList() const { imgDisplay, pageNo } = payload for (let e = 0; e < floatPositionList.length; e++) { @@ -2199,8 +2200,8 @@ export class Draw { this.imageParticle.render( ctx, element, - imgFloatPosition.x, - imgFloatPosition.y + imgFloatPosition.x * scale, + imgFloatPosition.y * scale ) } }