Skip to content

Commit

Permalink
Merge pull request #17 from virtual-labs/dev
Browse files Browse the repository at this point in the history
DXP2 review comments are rectified
  • Loading branch information
SOLVE-NITK authored Feb 21, 2025
2 parents 1d3ca95 + 33e64ef commit 9598a70
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions experiment/simulation/js/digit.js
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,11 @@ newPath.addEventListener("click", function () {
});

document.addEventListener("keydown", function (event) {
// if (event.key === "Backspace") {
// event.preventDefault();
// deleteLastEntry();
// }

if (event.key === "Enter") {
// Cancel the default action, if needed
event.preventDefault();
Expand Down Expand Up @@ -544,6 +549,14 @@ function markAllTrees(trees) {
ctx.restore();
}

function deleteLastEntry() {
createNewPathObject();
createNewLineObject();
createNewTreeObject();
loadImage();
closeModal();
}

///Lines
function markLines(lines) {
ctx.beginPath();
Expand Down Expand Up @@ -746,7 +759,9 @@ function namingRegionTree() {
<p>Name the point</p>
<input type="text" id="tree" oninput="getNameTree(event)"/>
<button id="saveTree" onclick="saveRegionTree()">Save
<button id="deleteTree" onclick="deleteLastEntry()">Delete
</button>
<div class="close" title="close" onclick="closeModal()">&#9587;</div>
</div>`;
content.innerHTML = regionPrompt;
Expand Down Expand Up @@ -919,6 +934,8 @@ function namingRegionPolygon() {
<input type="text" id="area" oninput="getNamePolygon(event)"/>
<button id="saveArea" onclick="saveRegionPolygon()">Save
</button>
<button id="deleteArea" onclick="deleteLastEntry()">Delete
</button>
<div class="close" title="close" onclick="closeModal()">&#9587;</div>
</div>`;
content.innerHTML = regionPrompt;
Expand Down Expand Up @@ -949,6 +966,8 @@ function namingRegionLine() {
<input type="text" id="line" oninput="getNameLine(event)"/>
<button id="saveLine" onclick="saveRegionLine()">Save
</button>
<button id="deleteLine" onclick="deleteLastEntry()">Delete
</button>
<div class="close" title="close" onclick="closeModal()">&#9587;</div>
</div>`;
content.innerHTML = regionPrompt;
Expand Down

0 comments on commit 9598a70

Please sign in to comment.