+
+
+
+/*
+ use first -> last note for slope, and then correct for disturbing
+ notes in between. */
+void
+Tuplet_spanner::calc_position_and_height (Real *offset, Real * dy) const
+{
+ Link_array<Note_column> column_arr=
+ Group_interface__extract_elements (this, (Note_column*)0, "columns");
+
+
+ Score_element * common = common_refpoint (get_elt_property ("columns"), Y_AXIS);
+
+ Direction d = directional_element (this).get ();
+
+ /*
+ Use outer non-rest columns to determine slope
+ */
+ int l = 0;
+ while (l <column_arr.size() && column_arr[l]->rest_b())
+ l ++;
+
+ int r = column_arr.size ()- 1;
+ while (r >= l && column_arr[r]->rest_b())
+ r--;
+
+ if (l < r)
+ {
+ *dy = column_arr[r]->extent (Y_AXIS) [d] + column_arr[r]->relative_coordinate (common, Y_AXIS)
+ - column_arr[l]->extent (Y_AXIS) [d] - column_arr[l]->relative_coordinate (common, Y_AXIS);
+ }
+ else
+ * dy = 0;
+
+
+ *offset = - d * infinity_f;
+
+ if (!column_arr.size ())
+ return;
+
+ Real x0 = column_arr[0]->relative_coordinate (0, X_AXIS);
+ Real x1 = column_arr.top ()->relative_coordinate (0, X_AXIS);