Increase perPixelTargetFind area Fabricjs

How i can increase perPixelTargetFind area in Fabricjs, because on ipad to hard target rect width 6-10 strokeWidth? But if increase area by 10 invisible pixels..what will be nice

Upvotes: 0

Views: 763

Answers (2)

AndreaBogazzi
AndreaBogazzi

Reputation: 14741

Well, you have to increase the padding of the object too.

So targetFindTolerance work when you are inside the natural bounding box. Outside the bounding box the perPixelTarget will not work.

So adding some tolerance will give you more target area from the inside of the rectangle but not from the outside.

Increasing the padding will give you bigger bounding box and so the ability of targetFindTolerance to work inside and outside the stroke.

Upvotes: 2

"targetFindTolerance" option. Read docs before ask in SO =)

Upvotes: 0

Related Questions