Skip to content

Commit 63fe4a5

Browse files
committed
Double click on proof focuses on the tree
1 parent 7a648b7 commit 63fe4a5

1 file changed

Lines changed: 12 additions & 1 deletion

File tree

src/app.js

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ const refreshList = () => {
188188
}
189189

190190
ol.innerHTML += `<li value="${i}" class="${entry.selected ? 'selected' : ''}">
191-
<span class="conclusion" onclick="javascript:selectProof(${i})">
191+
<span class="conclusion" onclick="javascript:selectProof(${i})" ondblclick="javascript:focusOnProof(${i})">
192192
${entry.proof.conclusion.unicode()}
193193
</span>
194194
<br>
@@ -238,6 +238,14 @@ const selectProof = i => {
238238
canvas.setActiveObject(canvas.item(i))
239239
canvas.renderAll()
240240
}
241+
const focusOnProof = i => {
242+
let obj = canvas.item(i)
243+
canvas.setActiveObject(obj)
244+
let pt = obj.getPointByOrigin("center", "center")
245+
canvas.absolutePan({x: pt.x - window.innerWidth / 2, y: pt.y - window.innerHeight / 2})
246+
canvas.setZoom(1)
247+
canvas.renderAll()
248+
}
241249

242250
document.getElementById('addLKGoal').addEventListener('click', async () => {
243251
addProof(new LKIncomplete(await modalSequentPrompt('Enter an LK goal sequent:')))
@@ -335,6 +343,9 @@ You can click on the <span style="color: ${incompleteColor}">orange</span> sciss
335343
</p>
336344
<p>
337345
For rules with premises, you can click on the <span style="background: ${foldColor}">gray</span> hide button (⃠) to hide the premises of a proof rule, which shows each premise as an ellipses. Clicking the same button again will reveal the premises. You can use this feature to clean up your workspace while working on large proofs.
346+
</p>
347+
<p>
348+
The left bar contains a list of proofs you are working on at a given time. You can click on the goal to select the proof tree in the workspace. Double clicking on the goal will pan you to the proof tree, and reset the zoom. The icon next to buttons for each proof shows whether you have finished the proof (<span class="resultOk">✓</span> or <span class="resultOk">✓*</span> if you have used Z3), or still working on your proof (<span class="resultIncomplete" title="Incomplete proof">✎</span>), or whether the proof has failed for some subtree (<span class="resultBad" title="A part of this proof has failed">✖</span>).
338349
</p>
339350
<p>
340351
As you work on the proof, you can click on the buttons on the left bar to either copy the <span class="latex">L<sup>a</sup>T<sub>e</sub>X</span> output for a given proof, or to save that proof onto your computer as a file. You can later reload the proof file into the proof assistant by clicking the "Load proof file" button on the top bar.

0 commit comments

Comments
 (0)