diff --git a/stitchcode/threads.js b/stitchcode/threads.js index c1f0bca0..6ecd5fb2 100644 --- a/stitchcode/threads.js +++ b/stitchcode/threads.js @@ -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); + } +};