From e35533859c2625123a73501c4f0769c2839e3969 Mon Sep 17 00:00:00 2001 From: xiaoqidun Date: Wed, 28 Oct 2026 11:57:28 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E7=BC=96=E8=BE=91=E8=83=BD=E5=8A=9B):=20?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E6=96=87=E5=AD=97=E8=BE=B9=E6=A1=86=E4=B8=8E?= =?UTF-8?q?=E6=94=B9=E5=AE=BD=E6=89=8B=E6=9F=84=E9=94=99=E4=BD=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- internal/webui/webui.go | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/internal/webui/webui.go b/internal/webui/webui.go index 2960165..b8e9c3c 100644 --- a/internal/webui/webui.go +++ b/internal/webui/webui.go @@ -3401,12 +3401,13 @@ func (e *businessEngine) editorObjects(index int, text *ofdgo.PageText) ([]any, inverse, _ := matrix.Invert() local := inverse.TransformBox(box) width := math.Max(object.TextObject.Size, local.X+local.W) - if layout != (ofdgo.TextLayout{}) { + if capability.LayoutKnown { item["paragraphWidth"] = frame.W + width = frame.W } frame = ofdgo.Box{W: width, H: math.Max(object.TextObject.Size, local.Y+local.H)} item["textFrame"] = map[string]any{"width": frame.W, "height": frame.H, "matrix": e.editorMatrix(matrix)} - if layout.Wrap { + if capability.LayoutKnown { bounds := matrix.TransformBox(frame) item["x"], item["y"], item["width"], item["height"] = bounds.X, bounds.Y, bounds.W, bounds.H } @@ -4017,16 +4018,17 @@ func (e *businessEngine) compositeObjects(args []platformValue) (any, error) { inverse, _ := member.Matrix.Invert() local := inverse.TransformBox(box) width := math.Max(object.Size, local.X+local.W) - if layout != (ofdgo.TextLayout{}) { + if member.Capabilities.LayoutKnown { frame, err := object.TextFrame() if err != nil { return nil, err } item["paragraphWidth"] = frame.W + width = frame.W } frame := ofdgo.Box{W: width, H: math.Max(object.Size, local.Y+local.H)} item["textFrame"] = map[string]any{"width": frame.W, "height": frame.H, "matrix": e.editorMatrix(member.Matrix)} - if layout.Wrap { + if member.Capabilities.LayoutKnown { bounds := member.Matrix.TransformBox(frame) item["x"], item["y"], item["width"], item["height"] = bounds.X, bounds.Y, bounds.W, bounds.H }