Skip to content

Commit 9713614

Browse files
committed
comments
1 parent 1e99c27 commit 9713614

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/controls/canvas/DrawPad.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ interface iProps {
2727
ReadOnly?: boolean;
2828
HideUpload?: boolean;
2929
HideClear?: boolean;
30+
//HideUndo?: boolean;
3031
HideColorPicker?: boolean;
3132
disabled?: boolean;
3233
/** true - will prompt user for his name, string will just sign as that string */
@@ -98,7 +99,7 @@ export const DrawPad: React.FunctionComponent<iProps> = (props) => {
9899
//because this is used in an addEventListener - need to have a ref to get the most up to date onChange
99100
if (onChangeRef.current) {
100101
let canvasValue = manager.toPng();
101-
setcanUndo(true);//todo - enable undo last??
102+
setcanUndo(true);
102103
onChangeRef.current(canvasValue);
103104
}
104105
});
@@ -265,6 +266,11 @@ export const DrawPad: React.FunctionComponent<iProps> = (props) => {
265266
disabled={props.disabled} buttonOnly value={props.LineColor} onChange={newColor => {
266267
setLineColor(newColor);
267268
}} />}
269+
{/* todo: undo isn't working properly
270+
{props.HideUndo || <ButtonEX disabled={!canUndo} title="Undo" icon={<ArrowUndoRegular />} onClick={() => {
271+
manager.undoLast();
272+
setcanUndo(manager.canUndo());
273+
}} />} */}
268274
{props.HideClear || <ButtonEX disabled={props.disabled || isNullOrEmptyString(props.Value)} title="Clear" icon={<DismissRegular />} onClick={() => {
269275
//can call clear on the canvas, or can call the onchange which will cause a re-draw
270276
setSigned(false);

0 commit comments

Comments
 (0)