From 2e56369f7923ca0abffc26eff75979450b5ed8fe Mon Sep 17 00:00:00 2001 From: Brendan Dahl Date: Mon, 18 Oct 2021 16:37:51 -0700 Subject: [PATCH] Indent the stepper on save/restore. Makes it easier to debug and visualize the graphics state changes in the debugger. --- web/debugger.js | 9 ++++++++- web/viewer.css | 1 + 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/web/debugger.js b/web/debugger.js index 7849cc4fb..216e01a22 100644 --- a/web/debugger.js +++ b/web/debugger.js @@ -292,6 +292,7 @@ const Stepper = (function StepperClosure() { this.breakPoints = initialBreakPoints; this.currentIdx = -1; this.operatorListIdx = 0; + this.indentLevel = 0; } init(operatorList) { @@ -382,8 +383,14 @@ const Stepper = (function StepperClosure() { table.appendChild(charCodeRow); table.appendChild(fontCharRow); table.appendChild(unicodeRow); + } else if (fn === "restore") { + this.indentLevel--; } - line.appendChild(c("td", fn)); + line.appendChild(c("td", " ".repeat(this.indentLevel * 2) + fn)); + if (fn === "save") { + this.indentLevel++; + } + if (decArgs instanceof HTMLElement) { line.appendChild(decArgs); } else { diff --git a/web/viewer.css b/web/viewer.css index ccf203847..cc772ec8b 100644 --- a/web/viewer.css +++ b/web/viewer.css @@ -1701,6 +1701,7 @@ html[dir="rtl"] #documentPropertiesOverlay .row > * { } #PDFBug table { font-size: 10px; + white-space: pre; } #PDFBug table.showText { border-collapse: collapse;