Fix font check before rendering page in the pdf editor
This commit is contained in:
Ilya Kirillov
2024-11-27 14:36:05 +03:00
parent d8eeb91261
commit bd8f04586f
2 changed files with 16 additions and 3 deletions

View File

@ -68,6 +68,9 @@
this.check_loaded_timer_id = -1;
this.endLoadingCallback = null;
// Счетчик загрузки шрифтов через метод LoadFonts
this.loadFontsCounter = 0;
this.perfStart = 0;
@ -331,8 +334,15 @@
}
};
this.isFontLoadInProgress = function()
{
return (this.isWorking() || this.loadFontsCounter > 0);
};
this.LoadFonts = function(fonts, callback)
{
++this.loadFontsCounter;
let fontMap = {}
if (fonts && Array.isArray(fonts))
@ -368,9 +378,12 @@
}
if (needLoad)
setTimeout(checkLoaded, 50);
else if (callback)
return setTimeout(checkLoaded, 50);
if (callback)
callback();
--globalLoader.loadFontsCounter;
};
checkLoaded();
}

View File

@ -2784,7 +2784,7 @@
let oDoc = this.getPDFDoc();
Asc.editor.checkLastWork();
if (oDoc.fontLoader.isWorking() || this.IsOpenFormsInProgress || AscCommon.CollaborativeEditing.waitingImagesForLoad) {
if (oDoc.fontLoader.isFontLoadInProgress() || this.IsOpenFormsInProgress || AscCommon.CollaborativeEditing.waitingImagesForLoad) {
this.paint();
return;
}