Don't set text scale to fractional values in touch-screen-pinch
authorPo Lu <luangruo@yahoo.com>
Thu, 30 May 2024 13:31:18 +0000 (21:31 +0800)
committerPo Lu <luangruo@yahoo.com>
Thu, 30 May 2024 13:31:50 +0000 (21:31 +0800)
* lisp/touch-screen.el (touch-screen-pinch): Take floor of
computed scale.

lisp/touch-screen.el

index ca02ca3caf61d90d9c1b11d9fe7018c0ba53413c..436b8d0954c8448240fdc4c58732e96d030cb754 100644 (file)
@@ -937,8 +937,8 @@ text scale by the ratio therein."
                               (aset touch-screen-aux-tool 7
                                     current-scale)))
         ;; Set the text scale.
-        (text-scale-set (+ start-scale
-                           (round (log scale text-scale-mode-step))))
+        (text-scale-set (floor (+ (round (log scale text-scale-mode-step))
+                                  start-scale)))
         ;; Subsequently move the row which was at the centrum to its Y
         ;; position.
         (if (and (not (eq current-scale