[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: `window-hscroll' does not report correct value when `text-scale-mode
Re: `window-hscroll' does not report correct value when `text-scale-mode' is on
Thu, 18 May 2017 18:10:32 +0300
> From: 路客 <address@hidden>
> Date: Thu, 18 May 2017 15:38:47 +0800
> I found `window-hscroll' function does not report a correct value
> if `text-scale-mode' is on. A simple test is to enable `ruler-mode'
> and edit something like the following "text-ruler":
> Now we add a next line with 500 characters and put the cursor at
> the end of it; then we use <shift-left_mouse> to decrease the font
> size *twice* (with text wrapping disabled and ruler-mode enabled
> to observe current `window-hscroll' value). We can now easily see
> the `window-hscroll' value is incorrect, by comparing against the
> above "text-ruler".
This is not a bug: window-hscroll reports its value in units of
canonical frame columns, so the value should indeed change when you
change the font size.
> Is there any way to get the "exact" hscroll value? Say, with pixel-wise
The value you get now is already exact, and is exactly equivalent to
the corresponding number of pixels. If you really need that in pixel
units, simply multiply by the value returned by frame-char-width.