-/* Find the loose columns in POSNS, and drape them around the columns
- specified in BETWEEN-COLS. */
-static void
-set_loose_columns (System* which, Column_x_positions const *posns)
-{
- int loose_col_count = posns->loose_cols_.size ();
- for (int i = 0; i < loose_col_count; i++)
- {
- int divide_over = 1;
- Item *loose = dynamic_cast<Item*> (posns->loose_cols_[i]);
- Paper_column* col = dynamic_cast<Paper_column*> (loose);
-
- if (col->system_)
- continue;
-
- Item *left = 0;
- Item *right = 0;
- while (1)
- {
- SCM between = loose->get_property ("between-cols");
- if (!scm_is_pair (between))
- break;
-
- Item *le = dynamic_cast<Item*> (unsmob_grob (scm_car (between)));
- Item *re = dynamic_cast<Item*> (unsmob_grob (scm_cdr (between)));
-
- if (!(le && re))
- break;
-
- if (!left && le)
- {
- left = le->get_column ();
- if (!left->get_system ())
- left = left->find_prebroken_piece (RIGHT);
- }
-
- divide_over++;
- loose = right = re->get_column ();
- }
-
- if (!right->get_system ())
- right = right->find_prebroken_piece (LEFT);
-
- /* Divide the remaining space of the column over the left and
- right side. At the moment, FIXME */
- Grob *common = right->common_refpoint (left, X_AXIS);
-
- Real rx = right->extent (common, X_AXIS)[LEFT];
- Real lx = left->extent (common, X_AXIS)[RIGHT];
- Real total_dx = rx - lx;
- Interval cval = col->extent (col, X_AXIS);
-
- /* Put it in the middle. This is not an ideal solution -- the
- break alignment code inserts a fixed space before the clef
- (about 1 SS), while the space following the clef is flexible.
- In tight situations, the clef will almost be on top of the
- following note. */
- Real dx = rx - lx - cval.length ();
- if (total_dx < 2* cval.length ())
- {
- /* TODO: this is discontinuous. I'm too tired to
- invent a sliding mechanism. Duh. */
- dx *= 0.25;
- }
- else
- dx *= 0.5;
-
- col->system_ = which;
- col->translate_axis (-col->relative_coordinate (common, X_AXIS), X_AXIS);
- col->translate_axis (lx + dx - cval[LEFT], X_AXIS);
- }
-}
-
-// const?