1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-22 16:18:08 +02:00

[Editor] Avoid to have slightly truncated images because of non-integer canvas dimensions

This commit is contained in:
Calixte Denizet 2023-08-10 13:18:02 +02:00
parent f89020e9b1
commit b6b51f57ed

View file

@ -338,6 +338,8 @@ class StampEditor extends AnnotationEditor {
}
#drawBitmap(width, height) {
width = Math.ceil(width);
height = Math.ceil(height);
const canvas = this.#canvas;
if (!canvas || (canvas.width === width && canvas.height === height)) {
return;