From: Mikko Rasa Date: Thu, 27 Jun 2013 13:36:09 +0000 (+0300) Subject: The slack column counter needs to be outside the slot loop X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=fea22d7bdfae9e2cb70a6c0c1a3f85da531e2de2;p=libs%2Fgltk.git The slack column counter needs to be outside the slot loop --- diff --git a/source/layout.cpp b/source/layout.cpp index 7902902..5ebb55c 100644 --- a/source/layout.cpp +++ b/source/layout.cpp @@ -340,6 +340,7 @@ void Layout::solve_constraints(int dir, SolveMode mode) remaining three are slack columns; see below for their purposes. */ LinearProgram linprog(n_active_slots*5+n_slack_constraints[dir]+1); float weight = slots.size(); + unsigned k = n_active_slots*5; for(list::iterator i=slots.begin(); i!=slots.end(); ++i) { if((*i)->index<0) @@ -396,7 +397,6 @@ void Layout::solve_constraints(int dir, SolveMode mode) /* Add rows for user-defined constraints. Constraints are always added in pairs, so it's only necessary to create a row for one half. */ - unsigned k = n_active_slots*5; for(list::iterator j=(*i)->constraints.begin(); j!=(*i)->constraints.end(); ++j) if(j->target.index>(*i)->index && (j->type&1)==dir) {