Ashish Ashish - 10 months ago 98
Javascript Question

Sketch.js : Change default brush size

I am using sketch.js library to draw something on canvas. Basically what I need is that the default brush size seems big to me. I want to change the default brush size. Please help in this. I have looked in this link but description on this link works after clicking on anchor tab. I want to change the size by default. Any help is appreciated.

Answer Source

somewhere in the sketch.js file there is this piece of code where you can change the default size.

Sketch = (function() {
function Sketch(el, opts) {
  this.el = el;
  this.canvas = $(el);
  this.context = el.getContext('2d');
  this.options = $.extend({
    toolLinks: true,
    defaultTool: 'marker',
    defaultColor: '#000000',
    defaultSize: 5 //<<< here you can change the default size
  }, opts);