From d7c7c29730902938f42a116541a1d26f59f074ea Mon Sep 17 00:00:00 2001 From: Val Erastov Date: Thu, 13 Aug 2015 00:30:21 -0700 Subject: [PATCH] make weight param modifiable --- web/app/sketcher/constr/constraints.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/web/app/sketcher/constr/constraints.js b/web/app/sketcher/constr/constraints.js index 96ea2264..6b8d4d5c 100644 --- a/web/app/sketcher/constr/constraints.js +++ b/web/app/sketcher/constr/constraints.js @@ -68,16 +68,17 @@ TCAD.constraints.ConstantWrapper = function(constr, mask) { /** @constructor */ TCAD.constraints.Weighted = function(constr, weight) { + this.weight = weight; this.params = constr.params; this.error = function() { - return constr.error() * weight; + return constr.error() * this.weight; }; this.gradient = function(out) { constr.gradient(out); for (var i = 0; i < out.length; i++) { - out[i] *= weight; + out[i] *= this.weight; } } };