Skip to content

Commit f356172

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 e8e971a commit f356172

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
@@ -33,15 +33,15 @@ export default class SignatureCanvas extends Component {
3333
}
3434

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

38-
this._handleMouseEvents();
39-
this._handleTouchEvents();
40-
this._resizeCanvas();
38+
this._handleMouseEvents()
39+
this._handleTouchEvents()
40+
this._resizeCanvas()
4141
}
4242

43-
componentWillUnmount() {
44-
this.off();
43+
componentWillUnmount () {
44+
this.off()
4545
}
4646

4747
clear = () => {
@@ -101,7 +101,7 @@ export default class SignatureCanvas extends Component {
101101
/* When zoomed out to less than 100%, for some very strange reason,
102102
some browsers report devicePixelRatio as less than 1
103103
and only part of the canvas is cleared then. */
104-
let ratio = Math.max(window.devicePixelRatio || 1, 1)
104+
let ratio = Math.max(window.devicePixelRatio || 1, 1)
105105

106106
// only change width/height if none has been passed in as a prop
107107
if (!width) {
@@ -110,7 +110,7 @@ export default class SignatureCanvas extends Component {
110110
if (!height) {
111111
canvas.height = canvas.offsetHeight * ratio
112112
}
113-
if(!width || !height) {
113+
if (!width || !height) {
114114
ctx.scale(ratio, ratio)
115115
this.clear()
116116
}

0 commit comments

Comments
 (0)