// Set all the tops and bottoms as appropriate to a mean of the // constrained range. Delete all the constraints and list. void TabConstraint::ApplyConstraints(TabConstraint_LIST* constraints) { int y_min = -MAX_INT32; int y_max = MAX_INT32; GetConstraints(constraints, &y_min, &y_max); int y = (y_min + y_max) / 2; TabConstraint_IT it(constraints); for (it.mark_cycle_pt(); !it.cycled_list(); it.forward()) { TabConstraint* constraint = it.data(); TabVector* v = constraint->vector_; if (constraint->is_top_) { v->SetYEnd(y); v->set_top_constraints(NULL); } else { v->SetYStart(y); v->set_bottom_constraints(NULL); } } delete constraints; }