diff --git a/plugins/workflow.cpp b/plugins/workflow.cpp index 798024f72..6e15a4537 100644 --- a/plugins/workflow.cpp +++ b/plugins/workflow.cpp @@ -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; } diff --git a/scripts/gui/workflow.lua b/scripts/gui/workflow.lua index 4a9e5c913..80c05d296 100644 --- a/scripts/gui/workflow.lua +++ b/scripts/gui/workflow.lua @@ -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)