mirror of
https://github.com/xibyte/jsketcher
synced 2025-12-11 19:05:07 +01:00
solve on circle drag
This commit is contained in:
parent
04d5264d32
commit
c692687f05
1 changed files with 11 additions and 0 deletions
|
|
@ -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();
|
||||
}
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in a new issue