Skip to content

Commit ee8f6d4

Browse files
committed
Update benchmark
1 parent 52f860f commit ee8f6d4

File tree

1 file changed

+17
-3
lines changed

1 file changed

+17
-3
lines changed

benchmark/js/area.js

+17-3
Original file line numberDiff line numberDiff line change
@@ -139,8 +139,22 @@ define(function(require) {
139139
ctx.beginPath();
140140
shape.buildPath(ctx, shape.style);
141141
ctx.closePath();
142-
if (ctx.isPointInPath(x, y)) {
143-
return true;
142+
shape.brushType = shape.brushTypeOnly || shape.brushType;
143+
if (
144+
shape.style.brushType === 'fill'
145+
|| shape.style.brushType === 'both'
146+
) {
147+
if (ctx.isPointInPath(x, y)) {
148+
return true;
149+
}
150+
}
151+
else if (
152+
shape.style.brushType === 'stroke'
153+
|| shape.style.brushType === 'both') {
154+
ctx.lineWidth = shape.style.lineWidth;
155+
if (ctx.isPointInStroke(x, y)) {
156+
return true;
157+
}
144158
}
145159
}
146160
}
@@ -199,7 +213,7 @@ define(function(require) {
199213
}
200214
}
201215

202-
addBenck('mathMethod', 'Math method');
216+
// addBenck('mathMethod', 'Math method');
203217
addBenck('buildPath', 'Native isPointInPath');
204218
addBenck('jsInsidePath', 'JS isPointInPath');
205219
// addBenck('pixelMethod', 'pixelMethod');

0 commit comments

Comments
 (0)