]> git.donarmstrong.com Git - lilypond.git/commitdiff
* scm/page-layout.scm (default-page-make-stencil): only add header
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Thu, 31 Mar 2005 13:09:53 +0000 (13:09 +0000)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Thu, 31 Mar 2005 13:09:53 +0000 (13:09 +0000)
if existing and not empty. Fixes spurious programming error.

* lily/span-bar.cc (print): don't make rounded edges for spanbars.

ChangeLog
lily/bar-line.cc
lily/include/bar-line.hh
lily/span-bar.cc
lily/stencil-scheme.cc
scm/output-ps.scm
scm/output-svg.scm
scm/output-tex.scm
scm/page-layout.scm

index 44b5b97e2aa740b873ddfeb797b332708e6cecb4..260bf447a2f2b0f88c4228a95167aa6e5aa2b305 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2005-03-31  Han-Wen Nienhuys  <hanwen@xs4all.nl>
+
+       * scm/page-layout.scm (default-page-make-stencil): only add header
+       if existing and not empty. Fixes spurious programming error.
+
+       * lily/span-bar.cc (print): don't make rounded edges for spanbars.
+
 2005-03-31  Erlend Aasland  <erlenda@gmail.com>
 
        * scm/output-tex.scm: implement {re,}setcolor
index fa803dbfdf72632dd4bbc9b0f2199f1fb094a9be..a6b5336202460be324069950eb688785cb65fb87 100644 (file)
@@ -33,13 +33,14 @@ Bar_line::print (SCM smob)
       if (sz <= 0)
        return SCM_EOL;
 
-      return compound_barline (me, str, sz).smobbed_copy ();
+      return compound_barline (me, str, sz, true).smobbed_copy ();
     }
   return SCM_EOL;
 }
 
 Stencil
-Bar_line::compound_barline (Grob *me, String str, Real h)
+Bar_line::compound_barline (Grob *me, String str, Real h,
+                           bool rounded)
 {
   Real kern = robust_scm2double (me->get_property ("kern"), 1);
   Real thinkern = robust_scm2double (me->get_property ("thin-kern"), 1);
@@ -54,8 +55,8 @@ Bar_line::compound_barline (Grob *me, String str, Real h)
   hair *= staffline;
   fatline *= staffline;
 
-  Stencil thin = simple_barline (me, hair, h);
-  Stencil thick = simple_barline (me, fatline, h);
+  Stencil thin = simple_barline (me, hair, h, rounded);
+  Stencil thick = simple_barline (me, fatline, h, rounded);
   Stencil dot = Font_interface::get_default_font (me)->find_by_name ("dots.dot");
 
   int lines = Staff_symbol_referencer::line_count (me);
@@ -142,9 +143,13 @@ Bar_line::compound_barline (Grob *me, String str, Real h)
 Stencil
 Bar_line::simple_barline (Grob *me,
                          Real w,
-                         Real h)
+                         Real h,
+                         bool rounded)
 {
-  Real blot = me->get_layout ()->get_dimension (ly_symbol2scm ("blotdiameter"));
+  Real blot =
+    rounded
+    ? me->get_layout ()->get_dimension (ly_symbol2scm ("blotdiameter"))
+    : 0.0;
 
   return Lookup::round_filled_box (Box (Interval (0, w), Interval (-h / 2, h / 2)), blot);
 }
index 657d95a4935e3302282dff619d8e70b6e59ded67..fc613da48b1584a3a0a51ee9edd73652ef8e453e 100644 (file)
@@ -18,8 +18,8 @@ class Bar_line
 public:
   static bool has_interface (Grob *);
 
-  static Stencil compound_barline (Grob *, String, Real height);
-  static Stencil simple_barline (Grob *, Real wid, Real height);
+  static Stencil compound_barline (Grob *, String, Real height, bool rounded);
+  static Stencil simple_barline (Grob *, Real wid, Real height, bool rounded);
   DECLARE_SCHEME_CALLBACK (get_staff_bar_size, (SCM));
   DECLARE_SCHEME_CALLBACK (print, (SCM));
   DECLARE_SCHEME_CALLBACK (before_line_breaking, (SCM));
index 2d76103c381829c1e82c9fc2b367bb9c223dd80d..4ed3029df79799567a2e12b984a8818bc4631427 100644 (file)
@@ -94,7 +94,8 @@ Span_bar::print (SCM smobbed_me)
            {
              Stencil interbar = Bar_line::compound_barline (staff_bar,
                                                             glyph_string,
-                                                            l.length ());
+                                                            l.length (),
+                                                            false);
              interbar.translate_axis (l.center (), Y_AXIS);
              span_bar_mol.add_stencil (interbar);
            }
@@ -120,7 +121,7 @@ Span_bar::width_callback (SCM element_smob, SCM scm_axis)
   /*
     urg.
   */
-  Stencil m = Bar_line::compound_barline (se, gl, 40 PT);
+  Stencil m = Bar_line::compound_barline (se, gl, 40 PT, false);
 
   return ly_interval2scm (m.extent (X_AXIS));
 }
index cfec55292ad2453535673a8f4dd9c1af046c33c4..e51fc41bcb8346d6112d4e28ef075b1158511b13 100644 (file)
@@ -26,6 +26,7 @@ LY_DEFINE (ly_translate_stencil_axis, "ly:stencil-translate-axis",
   SCM_ASSERT_TYPE (scm_is_number (amount), amount, SCM_ARG2, __FUNCTION__, "number");
 
   Real real_amount = scm_to_double (amount);
+
 #if 0
   SCM_ASSERT_TYPE (!isinf (real_amount) && !isnan (real_amount),
                   amount, SCM_ARG2, __FUNCTION__, "finite number");
index 51d6d968aad3aa1a911f904d3ca2025a3f504cec..dcfbfe0d1cb23d52c20363e13903cebd934c8c05 100644 (file)
@@ -13,8 +13,6 @@
 ;;;;   * text setting, kerning.
 ;;;;   * document output-interface
 
-(debug-enable 'backtrace)
-
 (define-module (scm output-ps)
   #:re-export (quote)
 
index 56665a6a792601c3aa53487df7fc113267202825..1e5d64b8c75df0721181be1c8781bb288a3ab7de 100644 (file)
@@ -17,7 +17,6 @@
 ;;;;  * inkscape SVG-font support
 ;;;;    - use fontconfig/fc-cache for now, see output-gnome.scm
 
-(debug-enable 'backtrace)
 (define-module (scm output-svg))
 (define this-module (current-module))
 
index 7d5bffda091fa6ffe8e95bb8a58d19ed7d5eced2..aec0f203571cf35ab5f20f810a5e426a6f348368 100644 (file)
@@ -6,8 +6,6 @@
 ;;;;                 Han-Wen Nienhuys <hanwen@cs.uu.nl>
 
 
-;; (debug-enable 'backtrace)
-
 ;; The public interface is tight.
 ;; It has to be, because user-code is evalled with this module.
 
index fb32fb6eeb9b5a69a5382310695d8117aad8fb82..bb288663dc53fa9c19f4b3eb9a5135095b0008a8 100644 (file)
@@ -77,6 +77,7 @@
  Offsets is a list of increasing numbers. They must be negated to
 create offsets.
  "
+
   (let* ((topmargin (ly:output-def-lookup layout 'topmargin))
 
        ;; TODO: naming vsize/hsize not analogous to TeX.
@@ -142,13 +143,18 @@ create offsets.
 
     (if #f
        (display (list
-                 "leftmargin" leftmargin "rightmargin" rightmargin)))
+                 "leftmargin " leftmargin "rightmargin " rightmargin
+                 )))
 
-    (set! page-stencil (ly:stencil-combine-at-edge
-                       page-stencil Y DOWN head 0. 0.))
+    (if (and
+        (ly:stencil? head)
+        (not (ly:stencil-empty? head)))
+       (set! page-stencil (ly:stencil-combine-at-edge
+                           page-stencil Y DOWN head 0. 0.)))
 
     (map add-system (zip lines offsets))
-    (if (ly:stencil? foot)
+    (if (and (ly:stencil? foot)
+            (not (ly:stencil-empty? foot)))
        (set! page-stencil
              (ly:stencil-add
               page-stencil