MCPcopy Index your code
hub / github.com/NikLever/ThreeJS-PathEditor / convertScreenToPath

Method convertScreenToPath

graph.js:338–343  ·  view source on GitHub ↗
( x, y )

Source from the content-addressed store, hash-verified

336 }
337
338 convertScreenToPath( x, y ){
339 const xOrg = this.canvas.width * this.config.yAxis;
340 const yOrg = this.canvas.height - this.canvas.height * this.config.xAxis;
341 const scale = (this.canvas.width * 0.95 - xOrg)/ this.config.xMax;
342 return { x: ( x - xOrg ) / scale, y: ( y - yOrg ) / scale };
343 }
344
345 convertPathToScreen( x, y ){
346 const xOrg = this.canvas.width * this.config.yAxis;

Callers 2

constructorMethod · 0.80
addNodeMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected