TeMPOraL / nyan-mode

Nyan Cat for Emacs! Nyanyanyanyanyanyanyanyanyan!
GNU General Public License v3.0
794 stars 68 forks source link

Cat and Rainbow does not scale well on Emacs 27 #48

Open tusooa opened 3 years ago

tusooa commented 3 years ago

image

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

RushanKhan1 commented 3 years ago

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

RushanKhan1 commented 3 years ago

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.

andreyyao commented 1 year ago

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

tusooa commented 1 year ago

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.

andreyyao commented 1 year ago

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)))