]> git.donarmstrong.com Git - lilypond.git/commitdiff
Revert "Uses special X alignment for instrument names."
authorMike Solomon <mike@apollinemike.com>
Sat, 30 Mar 2013 09:57:31 +0000 (10:57 +0100)
committerMike Solomon <mike@apollinemike.com>
Sat, 30 Mar 2013 09:57:31 +0000 (10:57 +0100)
This reverts commit 6e4e69f2735a764eab2e6f70f83546461da0203b.

lily/instrument-name-engraver.cc
lily/side-position-interface.cc
scm/define-grob-interfaces.scm
scm/define-grob-properties.scm
scm/define-grobs.scm
scm/output-lib.scm

index a0b0c2682f8c0deb6697ea59b2818d3ec5c02d6a..0abc7e432955bf8306b9f7f6704b02f9e4bdd766 100644 (file)
@@ -160,14 +160,14 @@ Instrument_name_engraver::stop_spanner ()
 
   for (vsize i = 0; i < axis_groups_.size (); i++)
     Pointer_group_interface::add_grob (text_spanner_,
-                                       ly_symbol2scm ("system-start-text-alignment-elements"),
+                                       ly_symbol2scm ("elements"),
                                        axis_groups_[i]);
 
   text_spanner_->set_bound (RIGHT,
                             unsmob_grob (get_property ("currentCommandColumn")));
 
   Pointer_group_interface::set_ordered (text_spanner_,
-                                        ly_symbol2scm ("system-start-text-alignment-elements"),
+                                        ly_symbol2scm ("elements"),
                                         false);
 
   text_spanner_ = 0;
index 5a8ecb74c91b8eac59f6489995b63daecfee2d80..4d8efe1ced4d0687fe0aa61ddf46fc0d190b8b14 100644 (file)
@@ -314,6 +314,16 @@ Side_position_interface::aligned_side (Grob *me, Axis a, bool pure, int start, i
       dim.set_minimum_height (staff_extents[dir]);
     }
 
+  // this seems kinda kludgy, as there is no apparent logic to it
+  // however, it is a holdover from the previous code and
+  // necessary for the InstrumentName grob
+  // TODO: find a better way to deal with this...
+  if (dim.is_empty ())
+    {
+      dim = Skyline (dim.direction ());
+      dim.set_minimum_height (0.0);
+    }
+
   // Many cross-staff grobs do not have good height estimations.
   // We give the grob the best chance of not colliding by shifting
   // it to the maximum height in the case of cross-staff alignment.
index df001959ce29ce41ac3c0420f3f57feff1eed08f..6068579995115078b81526a2793326f97c285de3 100644 (file)
@@ -264,8 +264,7 @@ interesting enough to maintain a hara-kiri staff."
 (ly:add-interface
  'system-start-text-interface
  "Text in front of the system."
- '(system-start-text-alignment-elements long-text
-   padding self-alignment-X self-alignment-Y text))
+ '(long-text self-alignment-X self-alignment-Y text))
 
 (ly:add-interface
  'tab-note-head-interface
index c35b5e19098350b29863b885583dc791486abba2..9afb49a0a32e4c3fb471df85f1ad3aea23f06ca4 100644 (file)
@@ -1174,8 +1174,6 @@ results, use @code{LEFT} and @code{RIGHT}.")
      (staff-symbol ,ly:grob? "The staff symbol grob that we are in.")
      (stem ,ly:grob? "A pointer to a @code{Stem} object.")
      (stems ,ly:grob-array? "An array of stem objects.")
-     (system-start-text-alignment-elements ,ly:grob-array? "Elements
-used to align system start text.")
 
      (tie ,ly:grob? "A pointer to a @code{Tie} object.")
      (ties ,ly:grob-array? "A grob array of @code{Tie} objects.")
index 5ff4c7f803802e701c096c6bdb07220d03b3f64c..19a767fba5cd980145fa33cd578053e3c606873b 100644 (file)
        (direction . ,LEFT)
        (font-series . bold)
        (padding . 1.0)
-       (self-alignment-X . ,RIGHT)
        (side-axis . ,X)
        (stencil . ,ly:text-interface::print)
-       (X-offset . ,stanza-number::calc-x-offset)
+       (X-offset . ,ly:side-position-interface::x-aligned-side)
        (Y-extent . ,grob::always-Y-extent-from-stencil)
        (meta . ((class . Item)
                 (interfaces . (font-interface
-                               self-alignment-interface
                                side-position-interface
                                stanza-number-interface
                                text-interface))))))
index 4ce2cd667f342e3cee7633f1137e9f6744919f89..4533cf2a965a8c95eb22b3dcf84d21dc2e5ad8f7 100644 (file)
@@ -1146,20 +1146,6 @@ and draws the stencil based on its coordinates.
           0.0))))
 
 
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;; stanza-number
-
-(define-public (stanza-number::calc-x-offset grob)
-  "We want @code{StanzaNumbers} to side-align to lyrics.
-Sometimes, however, this is not possible, as the lyrics
-they align to are hara-kiri'd. In this case, we self-align
-them to the right and tack on any padding."
-  (if (null? (ly:grob-object grob 'side-support-elements))
-      (+ (ly:self-alignment-interface::x-aligned-on-self grob)
-         (* (ly:grob-property grob 'direction LEFT)
-            (ly:grob-property grob 'padding 0.0)))
-      (ly:side-position-interface::x-aligned-side grob)))
-
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;; instrument names
 
@@ -1191,8 +1177,6 @@ them to the right and tack on any padding."
         (common (ly:grob-common-refpoint-of-array system elements X))
         (total-ext empty-interval)
         (align-x (ly:grob-property grob 'self-alignment-X 0))
-         (my-padding (ly:grob-property grob 'padding 0))
-         (ss (ly:staff-symbol-staff-space grob))
         (padding (min 0 (- (interval-length my-extent) indent)))
         (right-padding (- padding
                           (/ (* padding (1+ align-x)) 2))))
@@ -1211,15 +1195,14 @@ them to the right and tack on any padding."
            (unite-delims (1- l)))))
 
     (+
-     (- (interval-length my-extent))
-     (* -1 my-padding ss)
+     (ly:side-position-interface::x-aligned-side grob)
      right-padding
      (- (interval-length total-ext)))))
 
 (define-public (system-start-text::calc-y-offset grob)
 
   (define (live-elements-list me)
-    (let ((elements (ly:grob-object me 'system-start-text-alignment-elements)))
+    (let ((elements (ly:grob-object me 'elements)))
 
       (filter! grob::is-live?
                (ly:grob-array->list elements))))