]> git.donarmstrong.com Git - lilypond.git/commitdiff
* scm/define-grobs.scm (all-grob-descriptions): set
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Sun, 15 Jun 2003 19:49:17 +0000 (19:49 +0000)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Sun, 15 Jun 2003 19:49:17 +0000 (19:49 +0000)
knee-spacing-correction to 1.0

* lily/note-spacing.cc (stem_dir_correction): compute knee
correction using stem-thickness and head width.

* scm/define-grobs.scm (all-grob-descriptions): set
beamed-extreme-minimum-free-lengths to 1.25 for 32nd beams.
This fixes 32nd beams for noteheads in spaces quants.

ChangeLog
input/regression/spacing-knee.ly
input/test/knee-sym.ly
lily/note-spacing.cc
scm/define-grobs.scm

index f8c6c5a166fe2b573e4a7ce3ac99939e7bcde43a..ca43ff3871d93a2623623ed49ff4ba38ab8056a7 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
 2003-06-15  Han-Wen Nienhuys  <hanwen@cs.uu.nl>
 
+       * scm/define-grobs.scm (all-grob-descriptions): set
+       knee-spacing-correction to 1.0
+
+       * lily/note-spacing.cc (stem_dir_correction): compute knee
+       correction using stem-thickness and head width.
+
        * input/regression/beam-quanting-horizontal.ly: update texidoc
 
        * scm/define-grobs.scm (all-grob-descriptions): set
index f6176b52938eea6c7d9a0cc11fa833367e91f06e..300f8c96edb1f0a712ec46927cadfe843a2f51d6 100644 (file)
@@ -1,13 +1,18 @@
 \version "1.7.18"
 \header {
-texidoc = "For knees, the spacing correction is such that the
-stems are put at regular distances.
+
+    texidoc = "For knees, the spacing correction is such that the
+stems are put at regular distances. This effect takes into account the
+width of the note heads and the thickness of the stem.
 "
     }
 \score { \notes
 {
+g'8-[ g'8-]     
  g''8-[ g g'' g''] 
 
+ %\property Voice.Stem \override #'thickness = #10 
+ %g''8-[ g g'' g''] 
     }
 \paper { raggedright = ##t}
      }
index 132b648db7f01c8e14b3382283403d30077e9e36..6e618eedbb25bca474b075ec18d8f3647e1e08d7 100644 (file)
@@ -6,6 +6,6 @@
        \stemUp [ b8 \stemDown b'']
     }
     \paper{
-       linewidth = 0.0
+       raggedright = ##t 
     }
 }%% new-chords-done %%
index 8c291dbad384a6ab5681f729118aa29f36480b40..9aa593f6696c82c3cdfb5be81f380ab9531c8fe8 100644 (file)
@@ -18,6 +18,7 @@
 #include "separation-item.hh"
 #include "staff-spacing.hh"
 #include "accidental-placement.hh"
+#include "paper-def.hh"
 
 void
 Note_spacing::get_spacing (Grob *me, Item* right_col,
@@ -227,6 +228,7 @@ Note_spacing::stem_dir_correction (Grob*me, Item * rcolumn,
                        me->get_grob_property ("right-items"));
 
   Drul_array<Grob*> beams_drul(0,0);
+  Drul_array<Grob*> stems_drul(0,0);
   
   stem_dirs[LEFT] = stem_dirs[RIGHT] = CENTER;
   Interval intersect;
@@ -274,6 +276,7 @@ Note_spacing::stem_dir_correction (Grob*me, Item * rcolumn,
              continue;
            }
 
+         stems_drul[d] = stem;
          beams_drul[d] = Stem::get_beam (stem);
            
          
@@ -295,8 +298,6 @@ Note_spacing::stem_dir_correction (Grob*me, Item * rcolumn,
              correct_stem_dirs = false;
            }
          
-
-         
          Interval hp  = Stem::head_positions (stem);
          Real chord_start = hp[sd];      
          Real stem_end = Stem::stem_end_position (stem);
@@ -326,11 +327,32 @@ Note_spacing::stem_dir_correction (Grob*me, Item * rcolumn,
     {
       if (beams_drul[LEFT] && beams_drul[LEFT] == beams_drul[RIGHT])
        {
+         
          /*
            this is a knee: maximal correction.
          */
-         
-         correction = increment* stem_dirs[LEFT];
+         Real note_head_width = increment;
+         Grob * st = stems_drul[RIGHT];
+         Grob * head = st ? Stem::support_head (st)  : 0;
+
+         Interval head_extent;
+         if (head)
+           {
+             head_extent = head->extent (rcolumn, X_AXIS);
+
+             if (!head_extent.empty_b())
+               note_head_width = head_extent[RIGHT];
+
+             if (st)
+               {
+                 Real thick = gh_scm2double (st->get_grob_property ("thickness"))
+                   * st->get_paper ()->get_var ("linethickness");
+
+                 note_head_width -= thick;
+               }
+           }
+
+         correction = note_head_width* stem_dirs[LEFT];
          correction *= gh_scm2double (me->get_grob_property ("knee-spacing-correction"));
          *fixed += correction;
        }
index e2e527b4e5d7313ba82789884eb4684cd52f522e..f560463d0e4422c73ec6b7bdb563347172b79d8c 100644 (file)
      . (
        (breakable . #t)
        (stem-spacing-correction . 0.4)
-       (knee-spacing-correction . 0.75)
+
        (meta . ((interfaces . (spacing-interface staff-spacing-interface item-interface ))))
        ))
     (NoteSpacing
      . (
        (stem-spacing-correction . 0.5)
-       (knee-spacing-correction . 0.75)
+
+       ;; Changed this from 0.75.
+       ;; If you ever change this back, please document! --hwn
+       
+       (knee-spacing-correction . 1.0)
        (meta . ((interfaces . (spacing-interface note-spacing-interface item-interface ))))
        ))