New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

pure-canvas

Package Overview
Dependencies
Maintainers
1
Versions
62
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pure-canvas - npm Package Compare versions

Comparing version 0.1.3 to 0.1.4

2

package.json
{
"name": "pure-canvas",
"version": "0.1.3",
"version": "0.1.4",
"description": "TODO",

@@ -5,0 +5,0 @@ "main": "lib/index.js",

@@ -51,14 +51,20 @@ import Node, {Bounds, Point} from './Node';

private emitHitEvent(name: string, event: MouseEvent): void {
const point = this.eventToElementCoordinate(event);
const results = this.tree
.search({minX: point.x, minY: point.y, maxX: point.x, maxY: point.y})
.sort((a: IndexedNode, b: IndexedNode) => b.zIndex - a.zIndex)
.map((indexedNode: IndexedNode) => {
const untransformedPoint = indexedNode.transformers.reduceRight((point: Point, transformer: Transformer) => transformer.untransform(point), point);
return indexedNode.node.intersection(untransformedPoint);
})
.filter(Boolean);
this.emit(name, results[0], event);
let didSearch: boolean = false;
let result: Node = undefined;
this.emit(name, () => {
if (!didSearch) {
const point = this.eventToElementCoordinate(event);
const results = this.tree
.search({minX: point.x, minY: point.y, maxX: point.x, maxY: point.y})
.sort((a: IndexedNode, b: IndexedNode) => b.zIndex - a.zIndex)
.map((indexedNode: IndexedNode) => {
const untransformedPoint = indexedNode.transformers.reduceRight((point: Point, transformer: Transformer) => transformer.untransform(point), point);
return indexedNode.node.intersection(untransformedPoint);
})
.filter(Boolean);
result = results[0];
didSearch = true;
}
return result;
}, event);
}

@@ -65,0 +71,0 @@

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc