@ -326,9 +326,8 @@ public:
void setGoalCount(int v) { config.ival(0) = v; }
int goalGap() {
int cval = (config.ival(1) <= 0) ? 5 : config.ival(1);
int cmax = std::max(goalCount()-5, goalCount()/2);
return std::max(1, std::min(cmax, cval));
int cval = (config.ival(1) <= 0) ? std::min(5,goalCount()/2) : config.ival(1);
return std::max(1, std::min(goalCount()-1, cval));
}
void setGoalGap(int v) { config.ival(1) = v; }
@ -387,8 +387,7 @@ end
function NewConstraint:onRangeChange()
local cons = self.constraint
local lim = math.max(cons.goal_value-5, math.floor(cons.goal_value/2))
cons.goal_gap = math.max(1, math.min(cons.goal_gap, lim))
cons.goal_gap = math.max(1, math.min(cons.goal_gap, cons.goal_value-1))
end
JobConstraints = defclass(JobConstraints, guidm.MenuOverlay)