From 2c54acedd7cb4d25b3c079a207bc77915dbefdf7 Mon Sep 17 00:00:00 2001 From: Nikita Khromov Date: Mon, 20 Oct 2025 20:09:12 +0700 Subject: [PATCH] [pdf] Fix bug #77740 --- pdf/src/annotations/freeText.js | 30 ++++++++++++++++++------------ 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/pdf/src/annotations/freeText.js b/pdf/src/annotations/freeText.js index e81f7ab9b6..0d5ffceb16 100644 --- a/pdf/src/annotations/freeText.js +++ b/pdf/src/annotations/freeText.js @@ -460,18 +460,7 @@ } if (this.IsNeedRecalcSizes()) { - let oXfrm = this.getXfrm(); - if (oXfrm) { - let aRect = this.GetRect(); - AscCommon.ExecuteNoHistory(function() { - this.spPr.xfrm.extX = (aRect[2] - aRect[0]) * g_dKoef_pt_to_mm; - this.spPr.xfrm.extY = (aRect[3] - aRect[1]) * g_dKoef_pt_to_mm; - this.spPr.xfrm.offX = aRect[0] * g_dKoef_pt_to_mm; - this.spPr.xfrm.offY = aRect[1] * g_dKoef_pt_to_mm; - this.updateTransformMatrix(); - this.recalcGeometry(); - }, undefined, this); - } + this.RecalcSizes(); } if (this.recalcInfo.recalculateGeometry) @@ -488,6 +477,22 @@ this.SetNeedRecalc(false); }; + CAnnotationFreeText.prototype.RecalcSizes = function() { + let oXfrm = this.getXfrm(); + if (oXfrm) { + let aRect = this.GetRect(); + AscCommon.ExecuteNoHistory(function() { + this.spPr.xfrm.extX = (aRect[2] - aRect[0]) * g_dKoef_pt_to_mm; + this.spPr.xfrm.extY = (aRect[3] - aRect[1]) * g_dKoef_pt_to_mm; + this.spPr.xfrm.offX = aRect[0] * g_dKoef_pt_to_mm; + this.spPr.xfrm.offY = aRect[1] * g_dKoef_pt_to_mm; + this.updateTransformMatrix(); + this.recalcGeometry(); + }, undefined, this); + } + + this.SetNeedRecalcSizes(false); + } CAnnotationFreeText.prototype.RefillGeometry = function() { let aOrigRect = this.GetRect(); let aCallout = this.GetCallout(); // координаты выходящей стрелки @@ -1279,6 +1284,7 @@ this.SetInTextBox(true); } else { + this.selection.textSelection = this.GetTextBoxShape(); oContent.SelectAll(); if (oContent.IsSelectionEmpty() == false) oViewer.Api.WordControl.m_oDrawingDocument.TargetEnd();