lilypond-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

issue 5393: Another fingering vs. accidental problem (issue 346920043 by


From: torsten . haemmerle
Subject: issue 5393: Another fingering vs. accidental problem (issue 346920043 by address@hidden)
Date: Thu, 30 Aug 2018 10:31:32 -0700

Reviewers: ,

Message:
Please review.
Thanks,
Torsten

Description:
issue 5393: Another fingering vs. accidental problem

        modified:   ../input/regression/finger-chords-accidental.ly
        modified:   ../input/regression/finger-chords-dot.ly
Existing regression tests supplemented by critical collision cases.

        modified:   ../lily/new-fingering-engraver.cc
- dots of all noteheads considered to avoid collisionts with fingerings
- Y-offset callback had been too late for correct X positioning:
  (A) Y-center stencil for FingeringColumn
  ---or---
  (B) Setting Y-offset (considering Y-offset set by user plus
                        self-alignment-Y and parent-alignment-Y)
      This is compatible to current behaviour (except for being in time)
- add_string function removed (obsolete, never used)

Please review this at https://codereview.appspot.com/346920043/

Affected files (+28, -6 lines):
  M input/regression/finger-chords-accidental.ly
  M input/regression/finger-chords-dot.ly
  M lily/new-fingering-engraver.cc


Index: input/regression/finger-chords-accidental.ly
diff --git a/input/regression/finger-chords-accidental.ly b/input/regression/finger-chords-accidental.ly index c9d3353e6405058ef7761b04735115570f3c898c..d048951999f42f4f250163bc9bdc1741bb8edaf3 100644
--- a/input/regression/finger-chords-accidental.ly
+++ b/input/regression/finger-chords-accidental.ly
@@ -12,5 +12,11 @@
   r4
   \set fingeringOrientations = #'(left)
   <cis''-3 >
-  <cis''!-3 e''>
+  <cis''!-3 e''> r4
+  <e'-1 bis'> <d'-1 bis'!>
+  <bis'! e''-5> <bis'! g''-5>
+  <g'-1 bes'> <f'-1 bes'!>
+  <bes'! f''-5> <bes'! g''-5>
+  <e'-1 bis'-3 e''-5> <d'-1 bis'!-3 g''-5>
+  <g'-1 bes'-3 f''-5> <f'-1 bes'!-3 g''-5>
 }
Index: input/regression/finger-chords-dot.ly
diff --git a/input/regression/finger-chords-dot.ly b/input/regression/finger-chords-dot.ly index 06cbfa0e75f8780269d9469e0218f887ed43a7a2..1275316bf3e8561c1734e914a4dd276721e2c906 100644
--- a/input/regression/finger-chords-dot.ly
+++ b/input/regression/finger-chords-dot.ly
@@ -7,4 +7,5 @@
 \relative {
   \set fingeringOrientations = #'(right)
   <c'-\rightHandFinger #1 >4.. <d-3 f>4. r8.
+  <d a'-2 b d e>4. r8  <d-1 a'-2 b-3 d-4 e-5>4. r8
 }
Index: lily/new-fingering-engraver.cc
diff --git a/lily/new-fingering-engraver.cc b/lily/new-fingering-engraver.cc
index 06a3a8da9666669d7ab2d95672f167158887fe1b..1e82ed701c79c83b65df49662a0e53164c4aac59 100644
--- a/lily/new-fingering-engraver.cc
+++ b/lily/new-fingering-engraver.cc
@@ -78,7 +78,6 @@ protected:
                       vector<Finger_tuple> *,
                       Stream_event *, Stream_event *);
   void add_script (Grob *, Stream_event *, Stream_event *);
-  void add_string (Grob *, Stream_event *, Stream_event *);
   void position_scripts (SCM orientations, vector<Finger_tuple> *);
 };

@@ -282,11 +281,27 @@ New_fingering_engraver::position_scripts (SCM orientations,
           && unsmob<Grob> (ft.head_->get_object ("accidental-grob")))
         Side_position_interface::add_support (f,
unsmob<Grob> (ft.head_->get_object ("accidental-grob")));
-      else if (unsmob<Grob> (ft.head_->get_object ("dot")))
-        Side_position_interface::add_support (f,
- unsmob<Grob> (ft.head_->get_object ("dot")));
+      else if (Rhythmic_head::dot_count (ft.head_))
+        for (vsize j = 0; j < heads_.size (); j++)
+           if (Grob *d = unsmob<Grob> (heads_[j]->get_object ("dot")))
+             Side_position_interface::add_support (f, d);
+
+      if (horiz.size () > 1)  /* -> FingeringColumn */
+        {
+          Stencil *fs = f->get_stencil ();
+          fs->align_to (Y_AXIS, CENTER);
+        }
+      else
+        {
+          SCM self_align_y =
+                Self_alignment_interface::aligned_on_parent (f, Y_AXIS);
+          SCM yoff= f->get_property ("Y-offset");
+          if (scm_is_number (yoff))
+            self_align_y = scm_from_double (scm_to_double (self_align_y)
+                                          + scm_to_double (yoff));
+          f->set_property ("Y-offset", self_align_y);
+        }

-      Self_alignment_interface::set_aligned_on_parent (f, Y_AXIS);
       Side_position_interface::set_axis (f, X_AXIS);

       f->set_property ("direction", scm_from_int (hordir));





reply via email to

[Prev in Thread] Current Thread [Next in Thread]