Skip to content

Commit a10ce64

Browse files
committed
Keep full-page overlay images opaque
1 parent 9d20d06 commit a10ce64

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

src/display/blender/blender.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -417,9 +417,10 @@ class Blender {
417417
this.origDrawImage(offCanvas, 0, 0, sWidth, sHeight, dx, dy, dWidth, dHeight);
418418
}
419419
} else if (type === "overlay") {
420-
// Set the blending mode and global alpha for controlled opacity
421-
this.ctx.globalCompositeOperation = "source-over"; // Blending mode (e.g., "source-over", "multiply", etc.)
422-
this.ctx.globalAlpha = 0.8; // Opacity of the image being blended (0 = fully transparent, 1 = fully opaque)
420+
// Full-page scans often cover OCR text drawn earlier in the operator
421+
// list, so they must remain opaque or the hidden text bleeds through.
422+
this.ctx.globalCompositeOperation = "source-over";
423+
this.ctx.globalAlpha = entirePage ? 1 : 0.8;
423424
this.origDrawImage(...args);
424425
}
425426
}

0 commit comments

Comments
 (0)