Remove the workaround for bug 1820511

This commit is contained in:
Calixte Denizet 2026-04-13 16:49:07 +02:00
parent 96debf0c81
commit ec35057b46
No known key found for this signature in database
GPG Key ID: 0C5442631EE0691F
3 changed files with 6 additions and 22 deletions

View File

@ -271,11 +271,8 @@ class ImageResizer {
const prevWidth = newWidth;
const prevHeight = newHeight;
// See bug 1820511 (Windows specific bug).
// TODO: once the above bug is fixed we could revert to:
// newWidth = Math.floor(newWidth / 2);
newWidth = Math.floor(newWidth / step) - 1;
newHeight = Math.floor(newHeight / step) - 1;
newWidth = Math.floor(newWidth / step);
newHeight = Math.floor(newHeight / step);
const canvas = new OffscreenCanvas(newWidth, newHeight);
const ctx = canvas.getContext("2d");

View File

@ -903,15 +903,11 @@ class CanvasGraphics {
let nw = pw,
nh = ph;
if (ws > 2 && pw > 1) {
// See bug 1820511 (Windows specific bug).
// TODO: once the above bug is fixed we could revert to:
// nw = Math.ceil(pw / 2);
nw = pw >= 16384 ? Math.floor(pw / 2) - 1 || 1 : Math.ceil(pw / 2);
nw = Math.ceil(pw / 2);
ws /= pw / nw;
}
if (hs > 2 && ph > 1) {
// TODO: see the comment above.
nh = ph >= 16384 ? Math.floor(ph / 2) - 1 || 1 : Math.ceil(ph) / 2;
nh = Math.ceil(ph / 2);
hs /= ph / nh;
}
scaleSteps.push({ newWidth: nw, newHeight: nh });

View File

@ -624,19 +624,10 @@ class StampEditor extends AnnotationEditor {
const prevHeight = newHeight;
if (newWidth > 2 * width) {
// See bug 1820511 (Windows specific bug).
// TODO: once the above bug is fixed we could revert to:
// newWidth = Math.ceil(newWidth / 2);
newWidth =
newWidth >= 16384
? Math.floor(newWidth / 2) - 1
: Math.ceil(newWidth / 2);
newWidth = Math.ceil(newWidth / 2);
}
if (newHeight > 2 * height) {
newHeight =
newHeight >= 16384
? Math.floor(newHeight / 2) - 1
: Math.ceil(newHeight / 2);
newHeight = Math.ceil(newHeight / 2);
}
const offscreen = new OffscreenCanvas(newWidth, newHeight);