MCPcopy
hub / github.com/victorqribeiro/isocity / getPosition

Function getPosition

js/main.js:170–176  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

168}
169
170const getPosition = e => {
171 const _y = (e.offsetY - tileHeight * 2) / tileHeight
172 const _x = e.offsetX / tileWidth - ntiles / 2
173 x = Math.floor(_y - _x)
174 y = Math.floor(_x + _y)
175 return { x, y }
176}
177
178const viz = (e) => {
179 if (isPlacing)

Callers 2

clickFunction · 0.85
vizFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected