Skip to content

Commit

Permalink
fix: add draw undo/redo & closed issue #136
Browse files Browse the repository at this point in the history
  • Loading branch information
JoyZhou committed Mar 5, 2021
1 parent a4c3228 commit 648828f
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 5 deletions.
15 changes: 10 additions & 5 deletions src/app/dwv/dwv.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,13 @@
<mat-icon>arrow_drop_down</mat-icon>
</button>
<mat-menu #menu="matMenu" [overlapTrigger]="false" yPosition="below">
<button *ngFor="let tool of toolNames" mat-menu-item (value)="tool" (click)="onChangeTool(tool)">{{ tool }}</button>
<button *ngFor="let tool of toolNames" mat-menu-item (value)="tool" (click)="onChangeTool(tool)">{{ tool
}}</button>
</mat-menu>

<button mat-raised-button color="primary" (click)="onReset()" [disabled]="!dataLoaded">Reset</button>
<button mat-raised-button color="primary" (click)="onUndo()" [disabled]="!dataLoaded">undo</button>
<button mat-raised-button color="primary" (click)="onRedo()" [disabled]="!dataLoaded">redo</button>
<button mat-raised-button color="primary" (click)="openTagsDialog()" [disabled]="!dataLoaded">Tags</button>
</div>
<div class="layerContainer">
Expand All @@ -18,7 +21,9 @@
</div>
<div class="legend mat-small">
<p>Powered by
<a href="https://github.com/ivmartel/dwv">dwv</a>
{{ versions.dwv }}
and Angular {{ versions.angular }}</p></div>
</div>
<a href="https://github.com/ivmartel/dwv">dwv</a>
{{ versions.dwv }}
and Angular {{ versions.angular }}
</p>
</div>
</div>
14 changes: 14 additions & 0 deletions src/app/dwv/dwv.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,20 @@ export class DwvComponent implements OnInit {
}
}

/**
* handle an undo event
*/
onUndo(){
this.dwvApp.undo();
}

/**
* handle a redo event
*/
onRedo(){
this.dwvApp.redo();
}

/**
* Open the DICOM tags dialog.
*/
Expand Down

0 comments on commit 648828f

Please sign in to comment.