Skip to content

Commit 806a4c3

Browse files
committed
(format): 1 sentence = 1 line for docs
- more consistent with how I generally do it nowadays - this makes edits a lot easier than having to align line breaks to 80 chars - editor should wrap-around past a certain length, so still plenty readable - now both the code and README have finally been formatted - I put that off for a lonnng while, even avoiding committing it when my editor/linter did it automatically 😅
1 parent 310bff8 commit 806a4c3

File tree

1 file changed

+13
-24
lines changed

1 file changed

+13
-24
lines changed

README.md

Lines changed: 13 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,11 @@
1313

1414
A React wrapper component around [signature_pad](https://github.com/szimek/signature_pad).
1515

16-
Originally, this was just an _unopinionated_ fork of
17-
[react-signature-pad](https://github.com/blackjk3/react-signature-pad)
18-
that did not impose any styling or wrap any other unwanted elements around
19-
your canvas -- it's just a wrapper around a single canvas element! Hence the
20-
naming difference.
16+
Originally, this was just an _unopinionated_ fork of [react-signature-pad](https://github.com/blackjk3/react-signature-pad) that did not impose any styling or wrap any other unwanted elements around your canvas -- it's just a wrapper around a single canvas element!
17+
Hence the naming difference.
2118
Nowadays, this repo / library has significantly evolved, introducing new features, fixing various bugs, and now wrapping the upstream `signature_pad` to have its updates and bugfixes baked in.
2219

23-
This fork also allows you to directly pass [props](#props) to the underlying
24-
canvas element, has new, documented [API methods](#api) you can use, and has
25-
new, documented [props](#props) you can pass to it.
20+
This fork also allows you to directly pass [props](#props) to the underlying canvas element, has new, documented [API methods](#api) you can use, and has new, documented [props](#props) you can pass to it.
2621

2722
## Installation
2823

@@ -44,8 +39,8 @@ ReactDOM.render(
4439

4540
### Props
4641

47-
The props of SignatureCanvas mainly control the properties of the pen stroke
48-
used in drawing. All props are **optional**.
42+
The props of SignatureCanvas mainly control the properties of the pen stroke used in drawing.
43+
All props are **optional**.
4944

5045
- `velocityFilterWeight` : `number`, default: `0.7`
5146
- `minWidth` : `number`, default: `0.5`
@@ -56,8 +51,7 @@ used in drawing. All props are **optional**.
5651
- `penColor` : `string`, default: `'black'`
5752
- `throttle`: `number`, default: `16`
5853

59-
There are also two callbacks that will be called when a stroke ends and one
60-
begins, respectively.
54+
There are also two callbacks that will be called when a stroke ends and one begins, respectively.
6155

6256
- `onEnd` : `function`
6357
- `onBegin` : `function`
@@ -67,8 +61,7 @@ Additional props are used to control the canvas element.
6761
- `canvasProps`: `object`
6862
- directly passed to the underlying `<canvas />` element
6963
- `backgroundColor` : `string`, default: `'rgba(0,0,0,0)'`
70-
- used in the [API's](#api) `clear` convenience method (which itself is
71-
called internally during resizes)
64+
- used in the [API's](#api) `clear` convenience method (which itself is called internally during resizes)
7265
- `clearOnResize`: `bool`, default: `true`
7366
- whether or not the canvas should be cleared when the window resizes
7467

@@ -77,8 +70,7 @@ Of these props, all, except for `canvasProps` and `clearOnResize`, are passed th
7770

7871
### API
7972

80-
All API methods require a ref to the SignatureCanvas in order to use and are
81-
instance methods of the ref.
73+
All API methods require a ref to the SignatureCanvas in order to use and are instance methods of the ref.
8274

8375
```javascript
8476
<SignatureCanvas ref={(ref) => { this.sigCanvas = ref }} />
@@ -92,10 +84,9 @@ instance methods of the ref.
9284
- `toData()`: `pointGroupArray`, returns signature image as an array of point groups
9385
- `off()`: `void`, unbinds all event handlers
9486
- `on()`: `void`, rebinds all event handlers
95-
- `getCanvas()`: `canvas`, returns the underlying canvas ref. Allows you to
96-
modify the canvas however you want or call methods such as `toDataURL()`
97-
- `getTrimmedCanvas()`: `canvas`, creates a copy of the canvas and returns a
98-
trimmed version of it, with all whitespace removed.
87+
- `getCanvas()`: `canvas`, returns the underlying canvas ref.
88+
Allows you to modify the canvas however you want or call methods such as `toDataURL()`
89+
- `getTrimmedCanvas()`: `canvas`, creates a copy of the canvas and returns a trimmed version of it, with all whitespace removed.
9990
- `getSignaturePad()`: `SignaturePad`, returns the underlying SignaturePad reference.
10091

10192
The API methods are _mostly_ just wrappers around [`signature_pad`'s API](https://github.com/szimek/signature_pad#api).
@@ -108,8 +99,6 @@ The API methods are _mostly_ just wrappers around [`signature_pad`'s API](https:
10899
$ npm start
109100
```
110101

111-
Navigate to [http://localhost:8080/](http://localhost:8080/) in your browser
112-
and you should be able to see the signature canvas in action.
102+
Navigate to [http://localhost:8080/](http://localhost:8080/) in your browser and you should be able to see the signature canvas in action.
113103

114-
The source code for this example is found in the [`example/`](example/)
115-
directory.
104+
The source code for this example is found in the [`example/`](example/) directory.

0 commit comments

Comments
 (0)