Socket
Socket
Sign inDemoInstall

@antv/g-plugin-canvas-picker

Package Overview
Dependencies
13
Maintainers
64
Versions
211
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @antv/g-plugin-canvas-picker

A G plugin for picking in canvas


Version published
Weekly downloads
16K
increased by10.8%
Maintainers
64
Created
Weekly downloads
 

Readme

Source

@antv/g-plugin-canvas-picker

基于 Canvas2D API 实现的拾取:

  1. 使用 R-Tree 空间索引查找拾取点命中的一系列图形包围盒
  2. 在这些图形中找到最顶层的一个图形,依据 z-index
  3. 使用数学计算精确判定是否命中该图形,例如 Circle 测算到圆心距离是否小于半径

该方案基于 CPU,因此优化点在于包围盒相交运算是否足够快。

Keywords

FAQs

Last updated on 24 Apr 2024

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc