Reviewers: ,

Message:
Note that this applies only to staging until the next fast-forward of
master.

Cheers,
MS

Description:
Avoids TupletBracket-Fingering and TupletBracket-StringNumber
collisions.

Please review this at http://codereview.appspot.com/5505079/

Affected files:
  A input/regression/tuplet-bracket-avoid-fingering.ly
  A input/regression/tuplet-bracket-avoid-string-number.ly
  M lily/tuplet-engraver.cc


Index: input/regression/tuplet-bracket-avoid-fingering.ly
diff --git a/input/regression/tuplet-bracket-avoid-fingering.ly b/input/regression/tuplet-bracket-avoid-fingering.ly
new file mode 100644
index 0000000000000000000000000000000000000000..570d9d783d0ed83b91303f1e26dace45f3be0874
--- /dev/null
+++ b/input/regression/tuplet-bracket-avoid-fingering.ly
@@ -0,0 +1,12 @@
+\version "2.15.24"
+
+\header {
+  texidoc = "@code{TupletBracket} grobs avoid @code{Fingering} grobs.
+"
+}
+
+\relative d'' {
+ \override TupletBracket #'direction = #UP
+ \times 2/3 { d4 a8-4 }
+}
+
Index: input/regression/tuplet-bracket-avoid-string-number.ly
diff --git a/input/regression/tuplet-bracket-avoid-string-number.ly b/input/regression/tuplet-bracket-avoid-string-number.ly
new file mode 100644
index 0000000000000000000000000000000000000000..4a1b797b9fe1506b6940d03f896d970cb470101d
--- /dev/null
+++ b/input/regression/tuplet-bracket-avoid-string-number.ly
@@ -0,0 +1,12 @@
+\version "2.15.24"
+
+\header {
+  texidoc = "@code{TupletBracket} grobs avoid @code{StringNumber} grobs.
+"
+}
+
+\relative d'' {
+ \override TupletBracket #'direction = #UP
+ \times 2/3 { d4 <a\4>8 }
+}
+
Index: lily/tuplet-engraver.cc
diff --git a/lily/tuplet-engraver.cc b/lily/tuplet-engraver.cc
index 9ff42cad61ffad3731474952fa7cf3b8a9cf4352..a99369ccd78c4a883b42d51a57080cb1182a0c89 100644
--- a/lily/tuplet-engraver.cc
+++ b/lily/tuplet-engraver.cc
@@ -65,6 +65,8 @@ protected:

   DECLARE_ACKNOWLEDGER (note_column);
   DECLARE_ACKNOWLEDGER (script);
+  DECLARE_ACKNOWLEDGER (finger);
+  DECLARE_ACKNOWLEDGER (string_number);
   DECLARE_TRANSLATOR_LISTENER (tuplet_span);
   virtual void finalize ();
   void start_translation_timestep ();
@@ -220,6 +222,28 @@ Tuplet_engraver::acknowledge_script (Grob_info inf)
 }

 void
+Tuplet_engraver::acknowledge_finger (Grob_info inf)
+{
+  for (vsize j = 0; j < tuplets_.size (); j++)
+    if (tuplets_[j].bracket_)
+      {
+        Item *i = dynamic_cast<Item *> (inf.grob ());
+        Tuplet_bracket::add_script (tuplets_[j].bracket_, i);
+      }
+}
+
+void
+Tuplet_engraver::acknowledge_string_number (Grob_info inf)
+{
+  for (vsize j = 0; j < tuplets_.size (); j++)
+    if (tuplets_[j].bracket_)
+      {
+        Item *i = dynamic_cast<Item *> (inf.grob ());
+        Tuplet_bracket::add_script (tuplets_[j].bracket_, i);
+      }
+}
+
+void
 Tuplet_engraver::start_translation_timestep ()
 {
   last_tuplets_.clear ();
@@ -246,6 +270,8 @@ Tuplet_engraver::Tuplet_engraver ()

 ADD_ACKNOWLEDGER (Tuplet_engraver, note_column);
 ADD_ACKNOWLEDGER (Tuplet_engraver, script);
+ADD_ACKNOWLEDGER (Tuplet_engraver, finger);
+ADD_ACKNOWLEDGER (Tuplet_engraver, string_number);
 ADD_TRANSLATOR (Tuplet_engraver,
                 /* doc */
                 "Catch tuplet events and generate appropriate bracket.",



_______________________________________________
lilypond-devel mailing list
lilypond-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-devel

Reply via email to