MCPcopy Create free account
hub / github.com/devforth/painterro / activate

Method activate

js/primitive.js:10–18  ·  view source on GitHub ↗
(type)

Source from the content-addressed store, hash-verified

8 }
9
10 activate(type) {
11 this.type = type;
12 this.state = {};
13 if (type === 'line' || type === 'brush' || type === 'eraser' || type === 'arrow') {
14 this.ctx.lineJoin = 'round';
15 } else {
16 this.ctx.lineJoin = 'miter';
17 }
18 }
19
20 setLineWidth(width) {
21 if (`${width}`.match(/^\d+$/)) {

Callers 4

handleMouseDownMethod · 0.95
setDefaultsFunction · 0.45
constructorMethod · 0.45
setActiveToolMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected