CVSROOT: /cvsroot/lilypond
Module name: lilypond
Branch:
Changes by: Han-Wen Nienhuys <[EMAIL PROTECTED]> 05/05/30 09:45:14
Modified files:
. : ChangeLog
Documentation/user: point-and-click.itely
flower/include : interval.hh
lily : property-iterator.cc span-bar.cc
scm : lily.scm output-ps.scm
Log message:
* lily/span-bar.cc (print): sort bar line extents. Fixes problem
with disappearing span bars when alignAboveContext is active
* lily/property-iterator.cc (check_grob): use is-grob?
object-property. Fixes crash-key-sig-font-size.ly.
CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/lilypond/lilypond/ChangeLog.diff?tr1=1.3675&tr2=1.3676&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/lilypond/lilypond/Documentation/user/point-and-click.itely.diff?tr1=1.11&tr2=1.12&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/lilypond/lilypond/flower/include/interval.hh.diff?tr1=1.48&tr2=1.49&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/lilypond/lilypond/lily/property-iterator.cc.diff?tr1=1.53&tr2=1.54&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/lilypond/lilypond/lily/span-bar.cc.diff?tr1=1.103&tr2=1.104&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/lilypond/lilypond/scm/lily.scm.diff?tr1=1.348&tr2=1.349&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/lilypond/lilypond/scm/output-ps.scm.diff?tr1=1.141&tr2=1.142&r1=text&r2=text
Patches:
Index: lilypond/ChangeLog
diff -u lilypond/ChangeLog:1.3675 lilypond/ChangeLog:1.3676
--- lilypond/ChangeLog:1.3675 Sun May 29 10:01:31 2005
+++ lilypond/ChangeLog Mon May 30 09:45:13 2005
@@ -1,3 +1,11 @@
+2005-05-30 Han-Wen Nienhuys <[EMAIL PROTECTED]>
+
+ * lily/span-bar.cc (print): sort bar line extents. Fixes problem
+ with disappearing span bars when alignAboveContext is active
+
+ * lily/property-iterator.cc (check_grob): use is-grob?
+ object-property. Fixes crash-key-sig-font-size.ly.
+
2005-05-29 Han-Wen Nienhuys <[EMAIL PROTECTED]>
* lily/bar-line.cc (print): don't round barlines; this produces
Index: lilypond/Documentation/user/point-and-click.itely
diff -u lilypond/Documentation/user/point-and-click.itely:1.11
lilypond/Documentation/user/point-and-click.itely:1.12
--- lilypond/Documentation/user/point-and-click.itely:1.11 Thu May 12
11:32:49 2005
+++ lilypond/Documentation/user/point-and-click.itely Mon May 30 09:45:13 2005
@@ -21,7 +21,7 @@
For Xpdf on Unix, the following should be present in
@[EMAIL PROTECTED] unix, this file is found either in
[EMAIL PROTECTED]/etc} or your home directory.}
[EMAIL PROTECTED]/etc/xpdfrc} or as @file{.xpdfrc} in your home directory.}
@example
urlCommand "firefox -remote 'OpenURL(%s)'"
Index: lilypond/flower/include/interval.hh
diff -u lilypond/flower/include/interval.hh:1.48
lilypond/flower/include/interval.hh:1.49
--- lilypond/flower/include/interval.hh:1.48 Wed May 4 10:11:32 2005
+++ lilypond/flower/include/interval.hh Mon May 30 09:45:13 2005
@@ -119,6 +119,11 @@
elem_ref (LEFT) = elem (RIGHT);
elem_ref (RIGHT) = t;
}
+
+ static int left_comparison (Interval_t<T> const &a, Interval_t<T> const &b)
+ {
+ return sign (a[LEFT] - b[RIGHT]);
+ }
};
/**
Index: lilypond/lily/property-iterator.cc
diff -u lilypond/lily/property-iterator.cc:1.53
lilypond/lily/property-iterator.cc:1.54
--- lilypond/lily/property-iterator.cc:1.53 Tue Apr 12 22:49:27 2005
+++ lilypond/lily/property-iterator.cc Mon May 30 09:45:13 2005
@@ -71,27 +71,19 @@
}
}
-SCM list_p = 0;
-
-/*
- This is a rather crude check: we merely check if the translator
- property is a list.
-*/
bool
check_grob (Music *mus, SCM sym)
{
- if (!list_p)
- list_p = scm_c_eval_string ("list?");
-
- SCM type = scm_object_property (sym, ly_symbol2scm ("translation-type?"));
- bool ok = type == list_p;
+ bool g = to_boolean (scm_object_property (sym, ly_symbol2scm ("is-grob?")));
- if (!ok)
+ if (!g)
mus->origin ()->warning (_f ("not a grob name, `%s'",
ly_symbol2string (sym)));
- return ok;
+
+ return g;
}
+
void
Push_property_iterator::process (Moment m)
{
Index: lilypond/lily/span-bar.cc
diff -u lilypond/lily/span-bar.cc:1.103 lilypond/lily/span-bar.cc:1.104
--- lilypond/lily/span-bar.cc:1.103 Wed May 4 10:35:56 2005
+++ lilypond/lily/span-bar.cc Mon May 30 09:45:13 2005
@@ -32,11 +32,6 @@
ordered according to their y coordinates relative to their common
axis group parent. Otherwise, the computation goes mad.
-(TODO:
-apply a sort algorithm that ensures this precondition.) However,
-until now, I have seen no case where lily has not fulfilled this
-precondition.
-
(2) This method depends on bar_engraver not being removed from
staff context. If bar_engraver is removed, the size of the staff
lines is evaluated as 0, which results in a solid span bar line
@@ -48,17 +43,9 @@
Span_bar::print (SCM smobbed_me)
{
Grob *me = unsmob_grob (smobbed_me);
- SCM first_elt = me->get_property ("elements");
-
- /* compute common refpoint of elements */
- Grob *refp = me;
- for (SCM elts = first_elt; scm_is_pair (elts); elts = scm_cdr (elts))
- {
- SCM smobbed_staff_bar = scm_car (elts);
- Grob *staff_bar = unsmob_grob (smobbed_staff_bar);
- refp = staff_bar->common_refpoint (refp, Y_AXIS);
- }
+ SCM elements = me->get_property ("elements");
+ Grob *refp = common_refpoint_of_list (elements, me, Y_AXIS);
Span_bar::evaluate_glyph (me);
SCM glyph = me->get_property ("glyph");
@@ -70,17 +57,29 @@
String glyph_string = ly_scm2string (glyph);
/* compose span_bar_mol */
- Stencil span_bar_mol;
-
- Interval prev_extent;
- for (SCM elts = first_elt; scm_is_pair (elts); elts = scm_cdr (elts))
+ Array<Interval> extents;
+ Grob *model_bar = 0;
+ for (SCM elts = elements; scm_is_pair (elts); elts = scm_cdr (elts))
{
- SCM smobbed_staff_bar = scm_car (elts);
- Grob *staff_bar = unsmob_grob (smobbed_staff_bar);
- Interval ext = staff_bar->extent (refp, Y_AXIS);
+ Grob *bar = unsmob_grob (scm_car (elts));
+ Interval ext = bar->extent (refp, Y_AXIS);
if (ext.is_empty ())
continue;
+ extents.push (ext);
+ model_bar = bar;
+ }
+
+ if (!model_bar)
+ model_bar = me;
+
+ extents.sort (&Interval::left_comparison);
+
+ Stencil span_bar;
+ for (int i = 1; i < extents.size (); i ++)
+ {
+ Interval prev_extent = extents[i-1];
+ Interval ext = extents[i];
if (!prev_extent.is_empty ())
{
Interval l (prev_extent [UP],
@@ -92,21 +91,21 @@
}
else
{
- Stencil interbar = Bar_line::compound_barline (staff_bar,
+ Stencil interbar = Bar_line::compound_barline (model_bar,
glyph_string,
l.length (),
false);
interbar.translate_axis (l.center (), Y_AXIS);
- span_bar_mol.add_stencil (interbar);
+ span_bar.add_stencil (interbar);
}
}
prev_extent = ext;
}
- span_bar_mol.translate_axis (- me->relative_coordinate (refp, Y_AXIS),
+ span_bar.translate_axis (- me->relative_coordinate (refp, Y_AXIS),
Y_AXIS);
- return span_bar_mol.smobbed_copy ();
+ return span_bar.smobbed_copy ();
}
MAKE_SCHEME_CALLBACK (Span_bar, width_callback, 2);
Index: lilypond/scm/lily.scm
diff -u lilypond/scm/lily.scm:1.348 lilypond/scm/lily.scm:1.349
--- lilypond/scm/lily.scm:1.348 Sat May 28 13:43:24 2005
+++ lilypond/scm/lily.scm Mon May 30 09:45:14 2005
@@ -186,7 +186,6 @@
(define-public (ly:all-output-backend-commands)
"Return list of output backend commands."
'(
- comment
grob-cause
no-origin
placebox
Index: lilypond/scm/output-ps.scm
diff -u lilypond/scm/output-ps.scm:1.141 lilypond/scm/output-ps.scm:1.142
--- lilypond/scm/output-ps.scm:1.141 Sat May 28 13:43:24 2005
+++ lilypond/scm/output-ps.scm Mon May 30 09:45:14 2005
@@ -51,14 +51,6 @@
(scm framework-ps)
(lily))
-
-;;(map export
-;; (append (ly:all-stencil-expressions) (ly:all-output-backend-commands)))
-
-;; huh?
-;;(write (ly:all-output-backend-commands))
-;;(write (ly:all-stencil-expressions))
-
;;; helper functions, not part of output interface
(define (escape-parentheses s)
(regexp-substitute/global #f "(^|[^\\])([\\(\\)])" s 'pre 1 "\\" 2 'post))
_______________________________________________
Lilypond-cvs mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/lilypond-cvs