How to increase the selection area of a fabric Object?

fabricjs

Solution

Yes, we have `padding` value for that.

var lineObj = new fabric.Line([120,200,320,200], {
  stroke: '#000000',
  strokeWidth: 1,
  padding: 20
});
canvas.add(lineObj);

Did I mention Fabric is flexible and powerful? :)

@markE Nice solution! Glad you're finding it easy to walk through source code.

Problem

Consider the following code: ``` var lineObj = new fabric.Line([120,200,320,200],{ stroke: '#000000', strokeWidth: 1 }); canvas.add(lineObj); ``` This 1 pixel line is very hard to select owing to its very small width. What I wish to do here is to increase its selection area. Like this: Is there any way in which I can accomplish this?

Original source