Correct the distance to mouse-pointer block.

Correct the distance to mouse-pointer block.
pull/97/head
Simon-Mong 2021-08-21 22:07:12 +08:00 zatwierdzone przez GitHub
rodzic ce9dc47f4f
commit 6b6e56bba4
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
1 zmienionych plików z 11 dodań i 0 usunięć

Wyświetl plik

@ -55,3 +55,14 @@ Process.prototype.reportPi = function (min, max) {
Process.prototype.reportProxiedURL = function (url) {
return this.reportURL(this.proxy + '/' + url);
};
Process.prototype.origReportDistanceTo = Process.prototype.reportDistanceTo;
Process.prototype.reportDistanceTo = function (name) {
var thisObj = this.blockReceiver();
if (thisObj && this.inputOption(name) === 'mouse-pointer') {
return new Point(thisObj.xPosition(), thisObj.yPosition())
.distanceTo(new Point(this.reportMouseX(), this.reportMouseY()));
} else {
return this.origReportDistanceTo(name);
}
};