Apply scaling and ascept ratio on Sixel properly

* eat.el (eat--set-term-sixel-params): Make sure both numbers
of char-dimension is non-zero.
This commit is contained in:
Akib Azmain Turja 2023-10-03 23:31:52 +06:00
parent 94fb36161a
commit 8b3a38c1d5
No known key found for this signature in database
GPG key ID: 5535FCF54D88616B

8
eat.el
View file

@ -5077,10 +5077,10 @@ selection, or nil if none."
(scale-y eat-sixel-scale)
(font-size (font-get (font-spec :name (face-font 'default))
:size)))
(setf (car dimensions) (round (/ (car dimensions)
(float scale-x))))
(setf (cdr dimensions) (round (/ (cdr dimensions)
(float scale-y))))
(setf (car dimensions) (max 1 (round (/ (car dimensions)
(float scale-x)))))
(setf (cdr dimensions) (max 1 (round (/ (cdr dimensions)
(float scale-y)))))
(setf (eat-term-parameter eat-terminal 'sixel-render-format)
render-fmt)
(setf (eat-term-parameter eat-terminal 'char-dimensions)