Skip to content

Commit 729d505

Browse files
Randall Knutsonagilgur5
authored andcommitted
(fix): clear() should be after resize during mount
- if height and width are calculated the background color didn't get set on initial render previously, this fixes that
1 parent 1bda0ae commit 729d505

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,11 @@ export default class SignatureCanvas extends Component {
3232

3333
componentDidMount () {
3434
this._ctx = this._canvas.getContext("2d");
35-
this.clear();
3635

3736
this._handleMouseEvents();
3837
this._handleTouchEvents();
3938
this._resizeCanvas();
39+
this.clear()
4040
}
4141

4242
componentWillUnmount() {

0 commit comments

Comments
 (0)