Skip to content

Commit 845f26c

Browse files
committed
(docs): update README with new prop definition
- Add the `clearOnResize` definition - Move `backgroundColor` in the component's prop list to match the docs - nb: `backgroundColor` is still not perfectly defined as a prop - Change introductory language from "differences" to "new, documented" as "differences" could imply good and bad changes (e.g. new opinions), while "new" has a very different connotation and most API/props changes were backward compatible
1 parent 56cf03d commit 845f26c

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

README.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ your canvas -- it's just a wrapper around a single canvas element! Hence the
1212
naming difference.
1313

1414
This fork also allows you to directly pass [props](#props) to the underlying
15-
canvas element, has small [API differences](#api), and
16-
[documents the props](#props) you can pass to it.
15+
canvas element, has new, documented [API methods](#api) you can use, and has
16+
new, documented [props](#props) you can pass to it.
1717

1818
## Installation
1919

@@ -51,13 +51,15 @@ begins, respectively.
5151
- `onEnd` : `function`
5252
- `onBegin` : `function`
5353

54-
Two additional props are used to control the canvas element. `canvasProps` are
55-
directly passed to the underlying `<canvas />` element and `backgroundColor` is
56-
used in the [API's](#api) `clear` convenience method (which itself is called
57-
internally during resizes)
54+
Additional props are used to control the canvas element.
5855

5956
- `canvasProps`: `object`
57+
- directly passed to the underlying `<canvas />` element
6058
- `backgroundColor` : `string`, default: `'rgba(0,0,0,0)'`
59+
- used in the [API's](#api) `clear` convenience method (which itself is
60+
called internally during resizes)
61+
- `clearOnResize`: `bool`, default: `true`
62+
- whether or not the canvas should be cleared when the window resizes
6163

6264
### API
6365

src/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ export default class SignatureCanvas extends Component {
2626
return (this.props.minWidth + this.props.maxWidth) / 2
2727
},
2828
penColor: 'black',
29-
backgroundColor: 'rgba(0,0,0,0)',
3029
onEnd: () => {},
3130
onBegin: () => {},
31+
backgroundColor: 'rgba(0,0,0,0)',
3232
clearOnResize: true
3333
}
3434

0 commit comments

Comments
 (0)