mirror of
git://git.sv.gnu.org/emacs.git
synced 2026-02-16 17:24:23 +00:00
Correct initial scale calculation when pinching nonselected window
* lisp/touch-screen.el (touch-screen-pinch): Retrieve present scale within the window pinched. (touch-screen-handle-point-update): Expunge inefficacious code meant to disregard events sent during gesture navigation.
This commit is contained in:
parent
643c7fc851
commit
7d6896253b
1 changed files with 10 additions and 22 deletions
|
|
@ -908,16 +908,17 @@ text scale by the ratio therein."
|
|||
(require 'face-remap)
|
||||
(let* ((posn (cadr event))
|
||||
(window (posn-window posn))
|
||||
(current-scale (if text-scale-mode
|
||||
text-scale-mode-amount
|
||||
0))
|
||||
(start-scale (or (aref touch-screen-aux-tool 7)
|
||||
(aset touch-screen-aux-tool 7
|
||||
current-scale)))
|
||||
(scale (nth 2 event))
|
||||
(ratio-diff (nth 5 event)))
|
||||
(ratio-diff (nth 5 event))
|
||||
current-scale start-scale)
|
||||
(when (windowp window)
|
||||
(with-selected-window window
|
||||
(setq current-scale (if text-scale-mode
|
||||
text-scale-mode-amount
|
||||
0)
|
||||
start-scale (or (aref touch-screen-aux-tool 7)
|
||||
(aset touch-screen-aux-tool 7
|
||||
current-scale)))
|
||||
;; Set the text scale.
|
||||
(text-scale-set (+ start-scale
|
||||
(round (log scale text-scale-mode-step))))
|
||||
|
|
@ -1057,25 +1058,12 @@ then move point to the position of POINT."
|
|||
(cond ((or (null what)
|
||||
(eq what 'ancillary-tool))
|
||||
(let* ((last-posn (nth 2 touch-screen-current-tool))
|
||||
(original-posn (nth 4 touch-screen-current-tool))
|
||||
(col (and (not (posn-area original-posn))
|
||||
(car (posn-col-row original-posn
|
||||
(posn-window posn)))))
|
||||
;; Don't start horizontal scrolling if the touch
|
||||
;; point originated within two columns of the window
|
||||
;; edges, as systems like Android use those two
|
||||
;; columns to implement gesture navigation.
|
||||
(diff-x-eligible
|
||||
(and col (> col 2)
|
||||
(< col (- (window-width window) 2))))
|
||||
(diff-x (- (car last-posn) (car relative-xy)))
|
||||
(diff-y (- (cdr last-posn) (cdr relative-xy))))
|
||||
(when (or (> diff-y 10)
|
||||
(and diff-x-eligible
|
||||
(> diff-x (frame-char-width)))
|
||||
(> diff-x (frame-char-width))
|
||||
(< diff-y -10)
|
||||
(and diff-x-eligible
|
||||
(< diff-x (- (frame-char-width)))))
|
||||
(< diff-x (- (frame-char-width))))
|
||||
(setcar (nthcdr 3 touch-screen-current-tool)
|
||||
'scroll)
|
||||
(setcar (nthcdr 2 touch-screen-current-tool)
|
||||
|
|
|
|||
Loading…
Reference in a new issue