mirror of
https://github.com/mozilla/pdf.js.git
synced 2026-07-03 13:45:49 +02:00
Use optional chaining a little bit more in the src/display/api.js file
That format is preferred where possible, since it leads to ever so slightly shorter code overall.
This commit is contained in:
parent
873378b718
commit
5ef582fb20
@ -1530,10 +1530,9 @@ class PDFPageProxy {
|
|||||||
this._pumpOperatorList(intentArgs);
|
this._pumpOperatorList(intentArgs);
|
||||||
}
|
}
|
||||||
|
|
||||||
const recordForDebugger = Boolean(
|
const recordForDebugger = !!(
|
||||||
this._pdfBug && globalThis.StepperManager?.enabled
|
this._pdfBug && globalThis.StepperManager?.enabled
|
||||||
);
|
);
|
||||||
|
|
||||||
const shouldRecordOperations =
|
const shouldRecordOperations =
|
||||||
!this.recordedBBoxes && (recordOperations || recordForDebugger);
|
!this.recordedBBoxes && (recordOperations || recordForDebugger);
|
||||||
|
|
||||||
@ -1543,12 +1542,11 @@ class PDFPageProxy {
|
|||||||
if (shouldRecordOperations) {
|
if (shouldRecordOperations) {
|
||||||
const recordedBBoxes = internalRenderTask.gfx?.dependencyTracker.take();
|
const recordedBBoxes = internalRenderTask.gfx?.dependencyTracker.take();
|
||||||
if (recordedBBoxes) {
|
if (recordedBBoxes) {
|
||||||
if (internalRenderTask.stepper) {
|
internalRenderTask.stepper?.setOperatorBBoxes(
|
||||||
internalRenderTask.stepper.setOperatorBBoxes(
|
recordedBBoxes,
|
||||||
recordedBBoxes,
|
internalRenderTask.gfx.dependencyTracker.takeDebugMetadata()
|
||||||
internalRenderTask.gfx.dependencyTracker.takeDebugMetadata()
|
);
|
||||||
);
|
|
||||||
}
|
|
||||||
if (recordOperations) {
|
if (recordOperations) {
|
||||||
this.recordedBBoxes = recordedBBoxes;
|
this.recordedBBoxes = recordedBBoxes;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user