From 77d4857538e8b0dfb090ce5a540726d46e7d6001 Mon Sep 17 00:00:00 2001 From: Nikita Khromov Date: Fri, 27 Sep 2024 19:02:40 +0700 Subject: [PATCH] [pdf] Fix for text art --- pdf/src/document.js | 5 +++-- pdf/src/drawings/drawingPrototype.js | 2 ++ pdf/src/drawings/shape.js | 1 - 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/pdf/src/document.js b/pdf/src/document.js index 5048e84141..c13f1a5eb8 100644 --- a/pdf/src/document.js +++ b/pdf/src/document.js @@ -4471,11 +4471,12 @@ var CPresentation = CPresentation || function(){}; let oController = this.GetController(); - let oTextArt = this.GetController().createTextArt(nStyle, false); + let oTextArt = this.GetController().createTextArt(nStyle, false); oTextArt.SetDocument(this); oTextArt.SetPage(nPage); oTextArt.Recalculate(); - + oTextArt.checkExtentsByDocContent(); + let oXfrm = oTextArt.getXfrm(); let nRotAngle = this.Viewer.getPageRotate(nPage); diff --git a/pdf/src/drawings/drawingPrototype.js b/pdf/src/drawings/drawingPrototype.js index 222b0fcec9..ffd9979806 100644 --- a/pdf/src/drawings/drawingPrototype.js +++ b/pdf/src/drawings/drawingPrototype.js @@ -402,6 +402,8 @@ let result = content.EnterText(value); content.RecalculateCurPos(); + + this.checkExtentsByDocContent && this.checkExtentsByDocContent(); return result; }; CPdfDrawingPrototype.prototype.CorrectEnterText = function(oldValue, newValue) { diff --git a/pdf/src/drawings/shape.js b/pdf/src/drawings/shape.js index 3148fa48d0..15e19a3e70 100644 --- a/pdf/src/drawings/shape.js +++ b/pdf/src/drawings/shape.js @@ -70,7 +70,6 @@ this.recalculateTransform(); this.updateTransformMatrix(); this.recalculate(); - this.checkExtentsByDocContent(); this.recalculateShdw(); this.SetNeedRecalc(false); };