Merge pull request #21098 from calixteman/rm_workaround_1820511

Remove the workaround for bug 1820511
This commit is contained in:
calixteman 2026-04-13 21:28:49 +02:00 committed by GitHub
commit 2417d9aecb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
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);