Przeglądaj źródła

Input should no longer identify mouse as inbounds if target does not have focus.

dev
Bryan Miller 5 lat temu
rodzic
commit
305698599c
1 zmienionych plików z 7 dodań i 4 usunięć
  1. +7
    -4
      app/js/ui/Input.js

+ 7
- 4
app/js/ui/Input.js Wyświetl plik

@@ -451,10 +451,13 @@ export default class Input{
inbounds: true
}
if (this.__mouseTarget !== null){
var rect = this.__mouseTarget.getBoundingClientRect();
pos.x -= rect.left;
pos.y -= rect.top;
pos.inbounds = (pos.x >= 0 && pos.x < rect.width && pos.y >= 0 && pos.y < rect.height);
if (this.__mouseTarget === document.activeElement){
var rect = this.__mouseTarget.getBoundingClientRect();
pos.x -= rect.left;
pos.y -= rect.top;
pos.inbounds = (pos.x >= 0 && pos.x < rect.width && pos.y >= 0 && pos.y < rect.height);
}
pos.inbounds = false;
}
pos.x = Math.floor(pos.x);
pos.y = Math.floor(pos.y);

Ładowanie…
Anuluj
Zapisz