ソースを参照

Allow deselection of an entity by clicking within its bounding box

Clicks that hit the bounding box of any entity were unable to deselect, since
the canvas was not listening for mousedown events. It now is.
tags/v0.0.3
Fen Dweller 5年前
コミット
8221d29040
1個のファイルの変更2行の追加0行の削除
  1. +2
    -0
      macrovision.js

+ 2
- 0
macrovision.js ファイルの表示

@@ -491,6 +491,7 @@ function testClick(event) {
const oldDisplay = target.style.display;
target.style.display = "none";
const newTarget = document.elementFromPoint(event.clientX, event.clientY);
console.log(newTarget);
newTarget.dispatchEvent(new MouseEvent(event.type, {
"clientX": event.clientX,
"clientY": event.clientY
@@ -594,6 +595,7 @@ document.addEventListener("DOMContentLoaded", () => {
})

world.addEventListener("mousedown", e => deselect());
document.querySelector("#display").addEventListener("mousedown", deselect);
document.addEventListener("mouseup", e => clickUp(e));
document.addEventListener("touchend", e => {
console.log(e)


読み込み中…
キャンセル
保存