solve on circle drag

This commit is contained in:
Val Erastov 2015-02-10 01:06:29 -08:00
parent 04d5264d32
commit c692687f05

View file

@ -57,10 +57,19 @@ TCAD.TWO.EditCircleTool.prototype.mousemove = function(e) {
var p = this.viewer.screenToModel(e);
var r = TCAD.math.distance(p.x, p.y, this.circle.c.x, this.circle.c.y);
this.circle.r.set(r);
if (!e.shiftKey) {
this.solveRequest(2);
}
this.viewer.refresh();
}
};
TCAD.TWO.EditCircleTool.prototype.solveRequest = function(fineLevel) {
this.solver = this.viewer.parametricManager.prepare([this.circle.r]);
this.solver.solve(fineLevel);
this.solver.sync();
};
TCAD.TWO.EditCircleTool.prototype.mouseup = function(e) {
if (this.circle == null) {
var p = this.viewer.screenToModel(e);
@ -70,6 +79,8 @@ TCAD.TWO.EditCircleTool.prototype.mouseup = function(e) {
this.layer.objects.push(this.circle);
this.viewer.refresh();
} else {
this.solveRequest(0);
this.viewer.refresh();
this.viewer.toolManager.releaseControl();
}
};