CanvasPickerPlugin.d.ts 1.0 KB

1234567891011121314151617181920212223
  1. import type { BaseStyleProps, DisplayObject, RenderingPlugin, RenderingPluginContext, GlobalRuntime } from '@antv/g-lite';
  2. import { Point } from '@antv/g-lite';
  3. export type PointInPathPicker<T extends BaseStyleProps> = (displayObject: DisplayObject<T>, point: Point, isClipPath: boolean, isPointInPath: (displayObject: DisplayObject<T>, point: Point) => boolean, context: RenderingPluginContext, runtime: GlobalRuntime) => boolean;
  4. /**
  5. * pick shape(s) with Mouse/Touch event
  6. *
  7. * 1. find AABB with r-tree
  8. * 2. do math calculation with geometry in an accurate way
  9. */
  10. export declare class CanvasPickerPlugin implements RenderingPlugin {
  11. static tag: string;
  12. private context;
  13. private runtime;
  14. apply(context: RenderingPluginContext, runtime: GlobalRuntime): void;
  15. private pick;
  16. private isHit;
  17. /**
  18. * use native picking method
  19. * @see https://developer.mozilla.org/zh-CN/docs/Web/API/CanvasRenderingContext2D/isPointInPath
  20. */
  21. private isPointInPath;
  22. }
  23. //# sourceMappingURL=CanvasPickerPlugin.d.ts.map