]> git.donarmstrong.com Git - lilypond.git/commitdiff
* lily/tie-formatting-problem.cc (set_chord_outline): put dots
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Sun, 19 Feb 2006 15:14:00 +0000 (15:14 +0000)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Sun, 19 Feb 2006 15:14:00 +0000 (15:14 +0000)
in outline too.
(generate_configuration): for small ties, also look for collisions
at Y + DIR*h + DELTA_Y.
(get_variations): consider variation for dot positions too.

* lily/side-position-interface.cc (aligned_side): take abs for
quantized rounded position. Fixes tenuto below staff.

ChangeLog
THANKS
lily/side-position-interface.cc
lily/tie-formatting-problem.cc

index 75233cb455cae4339b960ebd637dfb324ddb9dbd..42d5170bfefa2272958384d96c653f949a747d09 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,14 @@
 2006-02-19  Han-Wen Nienhuys  <hanwen@xs4all.nl>
 
+       * lily/tie-formatting-problem.cc (set_chord_outline): put dots
+       in outline too.  
+       (generate_configuration): for small ties, also look for collisions
+       at Y + DIR*h + DELTA_Y.
+       (get_variations): consider variation for dot positions too.
+
+       * lily/side-position-interface.cc (aligned_side): take abs for
+       quantized rounded position. Fixes tenuto below staff.
+
        * scm/stencil.scm (annotate-y-interval): robustify: print nan/inf
        markers when necessary.
 
diff --git a/THANKS b/THANKS
index a6ea1c437961eaf1223c6843b0e13fcd31fcbdc2..c674cfc1664377aa3450e04c15ea6cef027b49e3 100644 (file)
--- a/THANKS
+++ b/THANKS
@@ -53,10 +53,12 @@ Vicente Solsona Dellá
 
 BUG HUNTERS/SUGGESTIONS
 
+Bertalan Fodor
 Bob Broadus
 Chris Sawer
 Christian Ebert
 Darius Blasband
+David Bobroff
 Donald Axel
 Don Blaheta
 Edward Neeman
@@ -66,18 +68,22 @@ Frédéric Bron
 Hans Forbrich
 Joe Neeman
 Jukka Akkanen
+Kieren Richard MacMillan
 Lambros Lambrou
 Laura Conrad
 Mark Steinheuser
 Matevž Jekovec
 Michael Welsh Duggan
 Milan Zamazal
+Orm Finnendahl
 Patrick K Welton
+Paul Scott
 Ralph Little
 Scott Russell
 Sean Reed
 Steven Weber
 Sven Axelsson
+Thomas Scharkowski
 Thomas Bushnell BSG
 Trent Johnston
 Trevor Bača
index f5f51bced2259832f7de93266bfa28a421780ae2..8836e30d24cacf8190788899b31d7a4ef5e4f881 100644 (file)
@@ -180,7 +180,7 @@ Side_position_interface::aligned_side (Grob *me, Axis a)
          Real rounded = directed_round (position, dir);
          Grob *head = me->get_parent (X_AXIS);
       
-         if (rounded <= 2 * Staff_symbol_referencer::staff_radius (me) 
+         if (fabs (rounded) <= 2 * Staff_symbol_referencer::staff_radius (me) 
              || (Note_head::has_interface (head)
                  && sign (Staff_symbol_referencer::get_position (head)) == - dir))
            {
index 916cb04adf5db439ada99c7dcf9878e2420de9a4..fb3b74ad39d932b9b69ed2281a9059382cc7736c 100644 (file)
@@ -65,6 +65,7 @@ Tie_formatting_problem::set_chord_outline (vector<Item*> bounds,
   Real staff_space = Staff_symbol_referencer::staff_space (bounds[0]);
 
   vector<Box> boxes;
+  vector<Box> head_boxes;
 
   Grob *stem = 0;
   for (vsize i = 0; i < bounds.size (); i++)
@@ -81,26 +82,26 @@ Tie_formatting_problem::set_chord_outline (vector<Item*> bounds,
                  (p+1) * 0.5 * staff_space);
 
       Interval x = head->extent (x_refpoint_, X_AXIS);
+      head_boxes.push_back (Box (x, y));
       boxes.push_back (Box (x, y));
 
       Grob *dots = Rhythmic_head::get_dots (head);
       if (d == LEFT && dots)
        {
          Interval x = dots->extent (x_refpoint_, X_AXIS);
-         Interval y (-0.5, 0.5);
          int p = int (Staff_symbol_referencer::get_position (dots));
-         y.translate (p);
 
          dot_positions_.insert (p);
          dot_x_.unite (x);
+
+         Interval y (dots->extent (dots, Y_AXIS));
+         y.translate (p * staff_space * 0.5);
          
-         y *= staff_space * 0.5;
-         // boxes.push_back (Box (x, y));
+         boxes.push_back (Box (x, y));
        }
     }
 
   chord_outlines_[d] = empty_skyline (-d);
-
   if (bounds[0]->break_status_dir ())
     {
       Real x = robust_relative_extent (bounds[0],  x_refpoint_, X_AXIS)[-d];
@@ -142,9 +143,9 @@ Tie_formatting_problem::set_chord_outline (vector<Item*> bounds,
     {
       Interval x;
       Interval y;
-      if (boxes.size())
+      if (head_boxes.size())
        {
-         Box b = boundary (boxes, updowndir, 0);
+         Box b = boundary (head_boxes, updowndir, 0);
          x = b[X_AXIS];
          x[-d] =  b[X_AXIS].linear_combination (-d / 2);
          y[-updowndir] = b[Y_AXIS][updowndir];
@@ -299,7 +300,7 @@ Tie_formatting_problem::get_configuration (int pos, Direction dir)
     }
 
   
-  Tie_configuration *conf = generate_configuration (pos,dir);
+  Tie_configuration *conf = generate_configuration (pos, dir);
   possibilities_[key] = conf;
   return conf;
 }
@@ -320,6 +321,21 @@ Tie_formatting_problem::generate_configuration (int pos, Direction dir) const
   conf->attachment_x_ = get_attachment (y + conf->delta_y_);
 
   Real h =  conf->height (details_);
+
+  if (h <  details_.intra_space_threshold_ * 0.5 * details_.staff_space_)
+    {
+      /*
+       This is less sensible for long ties, since those are more
+       horizontal.
+      */
+      Interval close_by = get_attachment (y
+                                         + conf->delta_y_
+                                         + (dir * details_.intra_space_threshold_ * 0.25
+                                            * details_.staff_space_));
+      
+      conf->attachment_x_.intersect (close_by);
+    }
+  
   if (!conf->delta_y_)
     {
       /*
@@ -776,12 +792,22 @@ Tie_formatting_problem::get_variations (Ties_configuration const &ties)
                  vars.push_back (var);
                }
            }
+         else if (dot_positions_.find (ties[i].position_) != dot_positions_.end ()
+                  && !specifications_[i].has_manual_position_)
+           {
+             Tie_configuration_variation var;
+             var.index_ = i;
+             var.suggestion_ = get_configuration (ties[i].position_  + ties[i].dir_,
+                                                  ties[i].dir_);
+             vars.push_back (var);
+           }
+         
        }
 
       last_center = center;
     }
 
-  /*  TODO: switch off? */
+  /* TODO: switch off? */
   Direction d = DOWN;
   do
     {
@@ -811,16 +837,16 @@ Tie_formatting_problem::set_manual_tie_configuration (SCM manual_configs)
        {
          Tie_specification &spec = specifications_[k];
 
-         if (scm_is_number (scm_cdr (entry)))
-           {
-             spec.has_manual_dir_ = true;
-             spec.manual_dir_ = Direction (scm_to_int (scm_cdr (entry)));
-           }
          if (scm_is_number (scm_car (entry)))
            {
              spec.has_manual_position_ = true;
              spec.manual_position_ = scm_to_double (scm_car (entry));
            }
+         if (scm_is_number (scm_cdr (entry)))
+           {
+             spec.has_manual_dir_ = true;
+             spec.manual_dir_ = Direction (scm_to_int (scm_cdr (entry)));
+           }
        }         
       k ++;
     }