Skip to content

Commit 0056e56

Browse files
committed
(format): move more formatting to Standard style
backport of v1.0.1 addition from 2afaa4d - not putting in much effort to re-format code that is removed/replaced in v1.0.0 however - remove some semicolons - more funcs and ifs should have same spacing - fix some spacing around an assignment
1 parent 85da29f commit 0056e56

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/index.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,15 @@ export default class SignatureCanvas extends Component {
3131
}
3232

3333
componentDidMount () {
34-
this._ctx = this._canvas.getContext("2d");
34+
this._ctx = this._canvas.getContext('2d')
3535

36-
this._handleMouseEvents();
37-
this._handleTouchEvents();
38-
this._resizeCanvas();
36+
this._handleMouseEvents()
37+
this._handleTouchEvents()
38+
this._resizeCanvas()
3939
}
4040

41-
componentWillUnmount() {
42-
this.off();
41+
componentWillUnmount () {
42+
this.off()
4343
}
4444

4545
clear = () => {
@@ -92,7 +92,7 @@ export default class SignatureCanvas extends Component {
9292
/* When zoomed out to less than 100%, for some very strange reason,
9393
some browsers report devicePixelRatio as less than 1
9494
and only part of the canvas is cleared then. */
95-
let ratio = Math.max(window.devicePixelRatio || 1, 1)
95+
let ratio = Math.max(window.devicePixelRatio || 1, 1)
9696

9797
// only change width/height if none has been passed in as a prop
9898
if (!width) {
@@ -101,7 +101,7 @@ export default class SignatureCanvas extends Component {
101101
if (!height) {
102102
canvas.height = canvas.offsetHeight * ratio
103103
}
104-
if(!width || !height) {
104+
if (!width || !height) {
105105
ctx.scale(ratio, ratio)
106106
this.clear()
107107
}

0 commit comments

Comments
 (0)