Skip to content

Commit d882d08

Browse files
committed
Move the IDENTITY_MATRIX constant into src/core/core_utils.js (PR 19772 follow-up)
After the changes in PR 19772 the `IDENTITY_MATRIX` constant is now only used on the worker-thread, which leads to Webpack marking the code as unused in the *built* `pdf.mjs` file; see https://phabricator.services.mozilla.com/D244533#change-8oITAexCvrlQ
1 parent 72feb4c commit d882d08

5 files changed

Lines changed: 6 additions & 5 deletions

File tree

src/core/annotation.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ import {
2525
BASELINE_FACTOR,
2626
FeatureTest,
2727
getModificationDate,
28-
IDENTITY_MATRIX,
2928
info,
3029
isArrayEqual,
3130
LINE_DESCENT_FACTOR,
@@ -44,6 +43,7 @@ import {
4443
getInheritableProperty,
4544
getParentToUpdate,
4645
getRotationMatrix,
46+
IDENTITY_MATRIX,
4747
isNumberArray,
4848
lookupMatrix,
4949
lookupNormalRect,

src/core/core_utils.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ const PDF_VERSION_REGEXP = /^[1-9]\.\d$/;
3030
const MAX_INT_32 = 2 ** 31 - 1;
3131
const MIN_INT_32 = -(2 ** 31);
3232

33+
const IDENTITY_MATRIX = [1, 0, 0, 1, 0, 0];
34+
3335
function getLookupTableFactory(initializer) {
3436
let lookup;
3537
return function () {
@@ -722,6 +724,7 @@ export {
722724
getParentToUpdate,
723725
getRotationMatrix,
724726
getSizeInBytes,
727+
IDENTITY_MATRIX,
725728
isAscii,
726729
isBooleanArray,
727730
isNumberArray,

src/core/evaluator.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ import {
1919
DrawOPS,
2020
FONT_IDENTITY_MATRIX,
2121
FormatError,
22-
IDENTITY_MATRIX,
2322
info,
2423
isArrayEqual,
2524
normalizeUnicode,
@@ -36,6 +35,7 @@ import { compileType3Glyph, FontFlags } from "./fonts_utils.js";
3635
import { ErrorFont, Font } from "./fonts.js";
3736
import {
3837
fetchBinaryData,
38+
IDENTITY_MATRIX,
3939
isNumberArray,
4040
lookupMatrix,
4141
lookupNormalRect,

src/core/pattern.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,14 @@
1616
import {
1717
assert,
1818
FormatError,
19-
IDENTITY_MATRIX,
2019
info,
2120
MathClamp,
2221
unreachable,
2322
Util,
2423
warn,
2524
} from "../shared/util.js";
2625
import {
26+
IDENTITY_MATRIX,
2727
isBooleanArray,
2828
isNumberArray,
2929
lookupMatrix,

src/shared/util.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ const isNodeJS =
2525
!process.versions.nw &&
2626
!(process.versions.electron && process.type && process.type !== "browser");
2727

28-
const IDENTITY_MATRIX = [1, 0, 0, 1, 0, 0];
2928
const FONT_IDENTITY_MATRIX = [0.001, 0, 0, 0.001, 0, 0];
3029

3130
// Represent the percentage of the height of a single-line field over
@@ -1303,7 +1302,6 @@ export {
13031302
getUuid,
13041303
getVerbosityLevel,
13051304
hexNumbers,
1306-
IDENTITY_MATRIX,
13071305
ImageKind,
13081306
info,
13091307
InvalidPDFException,

0 commit comments

Comments
 (0)