Fix image with text decluttering

This commit is contained in:
Andreas Hocevar
2021-01-14 22:22:32 +01:00
parent 58f533315d
commit fc20e77cea
9 changed files with 4064 additions and 4 deletions

View File

@@ -850,14 +850,15 @@ class Executor {
let imageArgs;
let imageDeclutterBox;
if (opt_declutterTree && declutterImageWithText) {
if (!declutterImageWithText[d]) {
const index = dd - d;
if (!declutterImageWithText[index]) {
// We now have the image for an image+text combination.
declutterImageWithText[d] = args;
declutterImageWithText[index] = args;
// Don't render anything for now, wait for the text.
continue;
}
imageArgs = declutterImageWithText[d];
delete declutterImageWithText[d];
imageArgs = declutterImageWithText[index];
delete declutterImageWithText[index];
imageDeclutterBox = getDeclutterBox(imageArgs);
if (opt_declutterTree.collides(imageDeclutterBox)) {
continue;