mirror of
https://github.com/konvajs/konva.git
synced 2025-10-15 12:34:52 +08:00
allow hitStrokeWidth usage, even if a shape has not stroke visible. fix #782
This commit is contained in:
10
src/Shape.ts
10
src/Shape.ts
@@ -370,6 +370,16 @@ export class Shape<Config extends ShapeConfig = ShapeConfig> extends Node<
|
||||
// this.getStrokeRadialGradientColorStops()
|
||||
);
|
||||
}
|
||||
hasHitStroke() {
|
||||
const width = this.hitStrokeWidth();
|
||||
|
||||
// we should enable hit stroke we stroke is enabled
|
||||
// and we have some value from width
|
||||
return (
|
||||
this.strokeEnabled() &&
|
||||
(width || this.strokeWidth() && width === 'auto')
|
||||
);
|
||||
}
|
||||
/**
|
||||
* determines if point is in the shape, regardless if other shapes are on top of it. Note: because
|
||||
* this method clears a temporary canvas and then redraws the shape, it performs very poorly if executed many times
|
||||
|
Reference in New Issue
Block a user