File tree 1 file changed +17
-3
lines changed
1 file changed +17
-3
lines changed Original file line number Diff line number Diff line change @@ -139,8 +139,22 @@ define(function(require) {
139
139
ctx . beginPath ( ) ;
140
140
shape . buildPath ( ctx , shape . style ) ;
141
141
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
+ }
144
158
}
145
159
}
146
160
}
@@ -199,7 +213,7 @@ define(function(require) {
199
213
}
200
214
}
201
215
202
- addBenck ( 'mathMethod' , 'Math method' ) ;
216
+ // addBenck('mathMethod', 'Math method');
203
217
addBenck ( 'buildPath' , 'Native isPointInPath' ) ;
204
218
addBenck ( 'jsInsidePath' , 'JS isPointInPath' ) ;
205
219
// addBenck('pixelMethod', 'pixelMethod');
You can’t perform that action at this time.
0 commit comments