From: hanwen Date: Wed, 13 Jul 2005 20:24:49 +0000 (+0000) Subject: (grob-bbox): don't use inf? X-Git-Tag: release/2.7.2~40 X-Git-Url: https://git.donarmstrong.com/lilypond.git?a=commitdiff_plain;h=2860d7d6ccf05aad551abde037b7d5d2878abd5a;p=lilypond.git (grob-bbox): don't use inf? --- diff --git a/ChangeLog b/ChangeLog index 396aa31208..ab728bbb06 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2005-07-13 Han-Wen Nienhuys + * scm/output-socket.scm (grob-bbox): don't use inf? + + * flower/include/rational.hh: add operator bool() + * scm/define-music-types.scm (music-descriptions): remove internal-class-name properties. diff --git a/scm/lily-library.scm b/scm/lily-library.scm index ef4254a748..ca682375c7 100644 --- a/scm/lily-library.scm +++ b/scm/lily-library.scm @@ -108,7 +108,7 @@ (set! count 0)) (if (> count 0) - (set! base (format #f "~a-~a" count))) + (set! base (format #f "~a-~a" base count))) (ly:parser-define! parser 'output-count (1+ count)) @@ -323,6 +323,10 @@ found." (cons (- (car iv) amount) (+ (cdr iv) amount))) + +(define-public (interval-empty? iv) + (> (car iv) (cdr iv))) + (define-public (interval-union i1 i2) (cons (min (car i1) (car i2)) (max (cdr i1) (cdr i2)))) diff --git a/scm/output-socket.scm b/scm/output-socket.scm index ddecbd0712..20a16b3bff 100644 --- a/scm/output-socket.scm +++ b/scm/output-socket.scm @@ -63,17 +63,19 @@ ((x-ext (ly:grob-extent grob grob X)) (y-ext (ly:grob-extent grob grob Y)) (x (car offset)) - (y (cdr offset)) - ) + (y (cdr offset))) + + (if (interval-empty? x-ext) + (set! x-ext '(0 . 0))) - (map (lambda (x) - (if (inf? x) 0.0 x)) - - (list (+ x (car x-ext)) - (+ y (car y-ext)) - (+ x (cdr x-ext)) - (+ y (cdr y-ext))) - ))) + (if (interval-empty? y-ext) + (set! y-ext '(0 . 0))) + + (list (+ x (car x-ext)) + (+ y (car y-ext)) + (+ x (cdr x-ext)) + (+ y (cdr y-ext)) + ))) (define-public (no-origin) "nocause\n")