]> git.donarmstrong.com Git - lilypond.git/commitdiff
Fix 893.
authorJoe Neeman <joeneeman@gmail.com>
Tue, 3 Nov 2009 00:37:28 +0000 (16:37 -0800)
committerJoe Neeman <joeneeman@gmail.com>
Tue, 3 Nov 2009 00:52:42 +0000 (16:52 -0800)
Move Side_position_interface::get_direction to Script_interface,
since it is only ever used for scripts (and it doesn't work
for rehearsal marks).

input/regression/rehearsal-mark-direction.ly [new file with mode: 0644]
lily/include/script-interface.hh
lily/include/side-position-interface.hh
lily/script-interface.cc
lily/side-position-interface.cc

diff --git a/input/regression/rehearsal-mark-direction.ly b/input/regression/rehearsal-mark-direction.ly
new file mode 100644 (file)
index 0000000..b4500cb
--- /dev/null
@@ -0,0 +1,16 @@
+\version "2.13.7"
+
+\header {
+  texidoc = "Rehearsal marks with direction DOWN get placed at
+the bottom of the score."
+}
+
+\new StaffGroup <<
+   \new Staff { g'1 }
+   \new Staff {
+     c'1
+     \once \override Score . RehearsalMark #'break-visibility = #begin-of-line-invisible
+     \once \override Score . RehearsalMark #'direction = #DOWN
+     \mark \markup \italic "Fine."
+   }
+ >>
index 2032b88296d4b0599d5a1c45568b1c7d484708bc..5081bf8a4845ebe2ee2cac31080b0cc390aaa35e 100644 (file)
@@ -21,6 +21,8 @@ class Script_interface
 {
 public:
   static Stencil get_stencil (Grob *, Direction d);
+  static Direction get_direction (Grob *);
+
   DECLARE_GROB_INTERFACE();
   DECLARE_SCHEME_CALLBACK (print, (SCM));
   DECLARE_SCHEME_CALLBACK (calc_direction, (SCM));
index 030403572055197c7afe111f382aa20de4b7fcb8..1dad3148e09fb79fbf314bc20ebd64ac7e34ad6d 100644 (file)
@@ -38,7 +38,6 @@ public:
   DECLARE_GROB_INTERFACE();
   static void add_support (Grob *, Grob *);
   static void add_staff_support (Grob *);
-  static Direction get_direction (Grob *);
 };
 
 #endif /* SIDE_POSITION_INTERFACE_HH */
index 59737b5ac49ff9ec84a0a6c3cf9f264ec82b9c5b..a0975e03fb481559dfc9855b9fe64d058cf0d043 100644 (file)
@@ -53,12 +53,28 @@ Script_interface::calc_positioning_done (SCM smob)
   return SCM_BOOL_T;
 }
 
+Direction
+Script_interface::get_direction (Grob *me)
+{
+  Direction relative_dir = Direction (1);
+  SCM reldir = me->get_property ("side-relative-direction");
+  if (is_direction (reldir))
+    relative_dir = to_dir (reldir);
+
+  SCM other_elt = me->get_object ("direction-source");
+  Grob *e = unsmob_grob (other_elt);
+  if (e)
+    return (Direction) (relative_dir * get_grob_direction (e));
+
+  return CENTER;
+}
+
 MAKE_SCHEME_CALLBACK (Script_interface, calc_direction, 1);
 SCM
 Script_interface::calc_direction (SCM smob)
 {
   Grob *me = unsmob_grob (smob);
-  Direction d = Side_position_interface::get_direction (me);
+  Direction d = Script_interface::get_direction (me);
 
   if (!d)
     {
@@ -126,11 +142,13 @@ ADD_INTERFACE (Script_interface,
               /* properties */
               "add-stem-support "
               "avoid-slur "
+              "direction-source "
               "positioning-done "
               "script-priority "
               "script-stencil "
-              "toward-stem-shift "
+              "side-relative-direction "
               "slur "
               "slur-padding "
+              "toward-stem-shift "
               );
 
index 0024408b79342e80234a2c071ca42deda26e2b3d..aab1045ee9c17d64e48153392be3c901ebf24c9b 100644 (file)
@@ -34,22 +34,6 @@ Side_position_interface::add_support (Grob *me, Grob *e)
   Pointer_group_interface::add_unordered_grob (me, ly_symbol2scm ("side-support-elements"), e);
 }
 
-Direction
-Side_position_interface::get_direction (Grob *me)
-{
-  Direction relative_dir = Direction (1);
-  SCM reldir = me->get_property ("side-relative-direction");
-  if (is_direction (reldir))
-    relative_dir = to_dir (reldir);
-
-  SCM other_elt = me->get_object ("direction-source");
-  Grob *e = unsmob_grob (other_elt);
-  if (e)
-    return (Direction) (relative_dir * get_grob_direction (e));
-
-  return CENTER;
-}
-
 /* Put the element next to the support, optionally taking in
    account the extent of the support.
 
@@ -318,7 +302,7 @@ Side_position_interface::move_to_extremal_staff (SCM smob)
 {
   Grob *me = unsmob_grob (smob);
   System *sys = dynamic_cast<System*> (me->get_system ());
-  Direction dir = Side_position_interface::get_direction (me);
+  Direction dir = get_grob_direction (me);
   if (dir != DOWN)
     dir = UP;
 
@@ -369,12 +353,10 @@ ADD_INTERFACE (Side_position_interface,
 
               /* properties */
               "direction "
-              "direction-source "
               "minimum-space "
               "padding "
               "quantize-position "
               "side-axis "
-              "side-relative-direction "
               "side-support-elements "
               "slur-padding "
               "staff-padding "