]> git.donarmstrong.com Git - lilypond.git/commitdiff
(grob-bbox): don't use inf?
authorhanwen <hanwen>
Wed, 13 Jul 2005 20:24:49 +0000 (20:24 +0000)
committerhanwen <hanwen>
Wed, 13 Jul 2005 20:24:49 +0000 (20:24 +0000)
ChangeLog
scm/lily-library.scm
scm/output-socket.scm

index 396aa31208222a94498676549561f0d4cad6aa1f..ab728bbb0606d87163f97b038051cc63a38f016c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 2005-07-13  Han-Wen Nienhuys  <hanwen@xs4all.nl>
 
+       * 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.
 
index ef4254a74881c3dd185253af5e7fc89a800894cf..ca682375c71cf250d66490743f786188ad50be43 100644 (file)
        (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))))
index ddecbd0712f70458a0214de7271c5a2d9a50edd4..20a16b3bfff361c26da8fa991a3f1f761620f4fd 100644 (file)
       ((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")