- {
- Direction dir = get_grob_direction (elements[i]);
- if (dir == CENTER)
- {
- warning (_ ("an outside-staff object should have a direction, defaulting to up"));
- dir = UP;
- }
-
- Box b (elements[i]->extent (x_common, X_AXIS),
- elements[i]->extent (y_common, Y_AXIS));
- SCM horizon_padding_scm = elements[i]->get_property ("outside-staff-horizontal-padding");
- Real horizon_padding = robust_scm2double (horizon_padding_scm, 0.0);
-
- if (b[X_AXIS][LEFT] - 2*horizon_padding < last_affected_position[dir])
- continue;
-
- if (!b[X_AXIS].is_empty () && !b[Y_AXIS].is_empty ())
- {
- boxes.clear ();
- boxes.push_back (b);
- Skyline other = Skyline (boxes, horizon_padding, X_AXIS, -dir);
- Real padding = robust_scm2double (elements[i]->get_property ("outside-staff-padding"), 0.5);
- Real dist = (*skylines)[dir].distance (other) + padding;
-
- if (dist > 0)
- {
- b.translate (Offset (0, dir*dist));
- elements[i]->translate_axis (dir*dist, Y_AXIS);
- }
- skylines->insert (b, 0, X_AXIS);
- elements[i]->set_property ("outside-staff-priority", SCM_BOOL_F);
- last_affected_position[dir] = b[X_AXIS][RIGHT];
- }
-
- /*
- Ugh: quadratic. --hwn
- */
- elements.erase (elements.begin () + i);
- }
+ {
+ Direction dir = get_grob_direction (elements[i]);
+ if (dir == CENTER)
+ {
+ warning (_ ("an outside-staff object should have a direction, defaulting to up"));
+ dir = UP;
+ }
+
+ Box b (elements[i]->extent (x_common, X_AXIS),
+ elements[i]->extent (y_common, Y_AXIS));
+ SCM horizon_padding_scm = elements[i]->get_property ("outside-staff-horizontal-padding");
+ Real horizon_padding = robust_scm2double (horizon_padding_scm, 0.0);
+
+ if (b[X_AXIS][LEFT] - 2 * horizon_padding < last_affected_position[dir])
+ continue;
+
+ if (!b[X_AXIS].is_empty () && !b[Y_AXIS].is_empty ())
+ {
+ boxes.clear ();
+ boxes.push_back (b);
+ Skyline other = Skyline (boxes, horizon_padding, X_AXIS, -dir);
+ Real padding = robust_scm2double (elements[i]->get_property ("outside-staff-padding"), 0.5);
+ Real dist = (*skylines)[dir].distance (other) + padding;
+
+ if (dist > 0)
+ {
+ b.translate (Offset (0, dir * dist));
+ elements[i]->translate_axis (dir * dist, Y_AXIS);
+ }
+ skylines->insert (b, 0, X_AXIS);
+ elements[i]->set_property ("outside-staff-priority", SCM_BOOL_F);
+ last_affected_position[dir] = b[X_AXIS][RIGHT];
+ }
+
+ /*
+ Ugh: quadratic. --hwn
+ */
+ elements.erase (elements.begin () + i);
+ }