nyan-mode icon indicating copy to clipboard operation
nyan-mode copied to clipboard

Cat and Rainbow does not scale well on Emacs 27

Open tusooa opened this issue 3 years ago • 5 comments

image

On Emacs 27 the rainbow segments have visible spaces between them, and the rainbow is significantly higher than the cat. image

tusooa avatar Sep 27 '20 08:09 tusooa

nyan-mode works perfectly when I use 1.00x scaling but when I increase the scaling I face this same problem.

RushanKhan1 avatar Oct 01 '20 10:10 RushanKhan1

I kinda found a way to make it somewhat better, locally. All you need to do Is resize all of the xpm images equally in the img folder to suit your particular scaling.

RushanKhan1 avatar Oct 09 '20 17:10 RushanKhan1

Are you launching emacs server as systemd service? I have the same problem, but the cat size appears to be normal when I launch emacs from my distro's application menu instead of as systemd OS: 5.16.18-1-MANJARO Emacs: 28.1 with native compilation

andreyyao avatar Jul 14 '22 03:07 andreyyao

Are you launching emacs server as systemd service? I have the same problem, but the cat size appears to be normal when I launch emacs from my distro's application menu instead of as systemd OS: 5.16.18-1-MANJARO Emacs: 28.1 with native compilation

I don't have systemd.

tusooa avatar Jul 14 '22 04:07 tusooa

Found a band-aid fix.

The issue is that in nyan.el, for some reason when the .xpm images are created in nyan-cat-image and nyan-animation-frames, the scaling wasn't automatically inferred by create-image even though it's supposed to.

Fix: add the following code to init file after the lines where you (nyan-mode t):

  (setq nyan-cat-image
        (create-image nyan-cat-face-image 'xpm nil :scale 2 :ascent 'center))
  (setq nyan-animation-frames
        (mapcar
	 (lambda (id)
           (create-image (concat nyan-directory (format "img/nyan-frame-%d.xpm" id))
                         'xpm nil :scale 2 :ascent 95))
         '(1 2 3 4 5 6)))

andreyyao avatar Feb 02 '23 17:02 andreyyao