Skip to content

Commit

Permalink
Fix for IE11
Browse files Browse the repository at this point in the history
  • Loading branch information
KhromovNikita authored and K0R0L committed Jan 28, 2025
1 parent 315a64b commit e62ad5e
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 9 deletions.
2 changes: 1 addition & 1 deletion common/apiCommon.js
Original file line number Diff line number Diff line change
Expand Up @@ -4769,7 +4769,7 @@ function (window, undefined) {
docInfo.put_Url(userAuth["wopiSrc"] + "/contents?access_token=" + userAuth["access_token"]);
}
docInfo.put_Title(fileInfo["BreadcrumbDocName"] || fileInfo["BaseFileName"]);
docInfo.put_CallbackUrl(JSON.stringify(userAuth),);
docInfo.put_CallbackUrl(JSON.stringify(userAuth));
docInfo.put_Token(token);
//todo does userInfo can change? (IsAnonymousUser)

Expand Down
2 changes: 1 addition & 1 deletion pdf/src/annotations/highlights.js
Original file line number Diff line number Diff line change
Expand Up @@ -479,7 +479,7 @@
};

function drawZigZagLine(oGraphicsPDF, X1, Y1, X2, Y2, nLineW) {
let length = Math.sqrt((X2 - X1)**2 + (Y2 - Y1)**2);
let length = Math.sqrt(Math.pow(X2 - X1, 2) + Math.pow(Y2 - Y1, 2));
// Параметры волны
let wavelength = 2; // длина одного "зубчика"
let amplitude = nLineW * 1; // высота волны
Expand Down
62 changes: 55 additions & 7 deletions pdf/src/file.js
Original file line number Diff line number Diff line change
Expand Up @@ -499,7 +499,7 @@ void main() {\n\
}
}
}
return { Page1, Page2, Line1, Line2, Glyph1, Glyph2 };
return { Page1: Page1, Page2: Page2, Line1: Line1, Line2: Line2, Glyph1: Glyph1, Glyph2: Glyph2 };
};
CFile.prototype.getSelection = function() {
return this.Selection;
Expand Down Expand Up @@ -638,7 +638,17 @@ void main() {\n\
if (_arrayGlyphOffsets[_glyph] > _distX)
break;
}
return { Line : _numLine, Glyph : --_glyph, ...(bNeedLinePos ? { LinePos: _linePos } : {}) };

let result = {
Line: _numLine,
Glyph: --_glyph
};

if (bNeedLinePos) {
result.LinePos = _linePos;
}

return result;
}

tmp = Infinity;
Expand Down Expand Up @@ -699,7 +709,17 @@ void main() {\n\
if (_arrayGlyphOffsets[_glyph] > w)
break;
}
return { Line : _numLine, Glyph : --_glyph, ...(bNeedLinePos ? { LinePos: _linePos } : {}) };

let result = {
Line: _numLine,
Glyph: --_glyph
};

if (bNeedLinePos) {
result.LinePos = _linePos;
}

return result;
}

if (w >= 0 && w <= _lineWidth)
Expand Down Expand Up @@ -737,7 +757,17 @@ void main() {\n\
_predY = _lineY;
_numLine++;
}
return { Line : _line, Glyph : _glyph, ...(bNeedLinePos ? { LinePos: _minLinePos } : {}) };

let result = {
Line: _line,
Glyph: _glyph
};

if (bNeedLinePos) {
result.LinePos = _minLinePos;
}

return result;
};
CFile.prototype.selectWholeWord = function(pageIndex, x, y) {
let ret = this.getNearestPos(pageIndex, x, y, true);
Expand Down Expand Up @@ -901,7 +931,13 @@ void main() {\n\
else if (this.Selection.quads.length)
return this.Selection.quads;

const { Page1, Page2, Line1, Line2, Glyph1, Glyph2 } = this.sortSelection();
let selection = this.sortSelection();
let Page1 = selection.Page1;
let Page2 = selection.Page2;
let Line1 = selection.Line1;
let Line2 = selection.Line2;
let Glyph1 = selection.Glyph1;
let Glyph2 = selection.Glyph2;

for (let iPage = Page1; iPage <= Page2; ++iPage)
{
Expand Down Expand Up @@ -1052,7 +1088,13 @@ void main() {\n\
if (!stream)
return;

const { Page1, Page2, Line1, Line2, Glyph1, Glyph2 } = this.sortSelection();
let selection = this.sortSelection();
let Page1 = selection.Page1;
let Page2 = selection.Page2;
let Line1 = selection.Line1;
let Line2 = selection.Line2;
let Glyph1 = selection.Glyph1;
let Glyph2 = selection.Glyph2;

if (Page1 > pageIndex || Page2 < pageIndex)
return;
Expand Down Expand Up @@ -1208,7 +1250,13 @@ void main() {\n\
if (!stream || !this.isSelectionUse())
return "";

const { Page1, Page2, Line1, Line2, Glyph1, Glyph2 } = this.sortSelection();
let selection = this.sortSelection();
let Page1 = selection.Page1;
let Page2 = selection.Page2;
let Line1 = selection.Line1;
let Line2 = selection.Line2;
let Glyph1 = selection.Glyph1;
let Glyph2 = selection.Glyph2;

if (Page1 > pageIndex || Page2 < pageIndex)
return "";
Expand Down

0 comments on commit e62ad5e

Please sign in to comment.