From d51629859491c1c2c53b9fd98826dd1bba4ad866 Mon Sep 17 00:00:00 2001 From: Val Erastov Date: Thu, 2 Oct 2014 00:23:00 -0700 Subject: [PATCH] realtime solving --- web/app/canvas.js | 1 + web/app/parametric.js | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/web/app/canvas.js b/web/app/canvas.js index 934fffc1..56964b1e 100644 --- a/web/app/canvas.js +++ b/web/app/canvas.js @@ -566,6 +566,7 @@ TCAD.TWO.DragTool.prototype.mousemove = function(e) { this.viewer.screenToModel2(e.x, e.y, this._point); this.obj.translate(this._point.x - x, this._point.y - y); this.viewer.refresh(); + this.solveRequest(); }; TCAD.TWO.DragTool.prototype.mousedown = function(e) { diff --git a/web/app/parametric.js b/web/app/parametric.js index 36f969b5..08aed1b0 100644 --- a/web/app/parametric.js +++ b/web/app/parametric.js @@ -171,7 +171,7 @@ TCAD.TWO.ParametricManager.prototype.solve = function(locked, onSolved) { xhr.onreadystatechange=function() { if (xhr.readyState == 4 && xhr.status == 200) { var response = JSON.parse(xhr.responseText); - if (response.reqId != request.reqId) { + if (response.reqId != pm.REQUEST_COUNTER - 1) { return; } for (var p = 0; p < response.params.length; ++p) {