mirror of
https://github.com/mozilla/pdf.js.git
synced 2026-06-11 12:41:03 +02:00
Merge pull request #21098 from calixteman/rm_workaround_1820511
Remove the workaround for bug 1820511
This commit is contained in:
commit
2417d9aecb
@ -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");
|
||||
|
||||
@ -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 });
|
||||
|
||||
@ -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);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user