[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: master 4b5d04b: Use new macro debounce-reduce to make mouse scaling
From: |
Stefan Monnier |
Subject: |
Re: master 4b5d04b: Use new macro debounce-reduce to make mouse scaling of images more responsive |
Date: |
Wed, 27 Nov 2019 17:55:19 -0500 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) |
>> #'image--change-size
>> (if n
>> (- 1 (/ (prefix-numeric-value n) 10.0))
>> 0.8)))
> This version doesn't discard a sequence of consecutive calls
> where every call is a costly operation. For example, on slow hardware
> every image resize takes about 1 sec.
I understand that but I don't see why you connect the two:
AFAICT `image--change-size` is a very lightweight function which just
changes one value in a plist. The costly operation happens later during
redisplay. So if those consecutive calls happen without any redisplay
between them, you should pay for the costly operation only once.
> Thus when mouse-wheel generates 5 events, this version will wait for
> the next idle time, then will resize the image sequentially 5 times
> during 5 seconds.
I would expect that after the idle time it will call
`image--change-size` five times and then perform one costly
recomputation with the resulting new size.
Stefan