INNER CODE UNIT · TypeScript

dy

jamesroutley/24a2 · src/engine.ts:397

          const dy = this._dotSize / 2 + y * offset;

          const distance = Math.sqrt(
            Math.pow(cx - dx, 2) + Math.pow(cy - dy, 2)
          );

          if (distance < this._dotSize / 2) {
            this._dotClicked(x, y);
            // We've found the dot, so exit early
            return;
          }
        }
      }
    }

    this._canvas.addEventListener("click", onMouseClick.bind(this));
  }

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…