]> git.eshelyaron.com Git - emacs.git/commitdiff
(animate-string): Handle case that the string is
authorGerd Moellmann <gerd@gnu.org>
Wed, 1 Aug 2001 08:02:45 +0000 (08:02 +0000)
committerGerd Moellmann <gerd@gnu.org>
Wed, 1 Aug 2001 08:02:45 +0000 (08:02 +0000)
longer than the window is wide.

lisp/play/animate.el

index 5ddd90d5a7221d96d7b560837dfcbaea2ecaa47e..ee0c070912f11ff344f08de72ca05242601855dd 100644 (file)
@@ -101,7 +101,7 @@ in the current window."
                             (or hpos
                                 ;; HPOS unspecified, so compute
                                 ;; it so as to center the string.
-                                (/ (- (window-width) (length string)) 2)))))
+                                (max 0 (/ (- (window-width) (length string)) 2))))))
     (dotimes (i animate-n-steps)
       ;; Bind buffer-undo-list so it will be unchanged when we are done.
       ;; (We're going to undo all our changes anyway.)