INNER CODE UNIT · TypeScript

distance

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

          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));
  }

  private _listenForKeyPress() {
    function onKeyPress(this: CanvasIOManager, event: KeyboardEvent) {

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…