emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: "Fix" sag scaling for hidpi


From: Alan Third
Subject: Re: "Fix" sag scaling for hidpi
Date: Sat, 13 Feb 2021 12:54:50 +0000

On Sat, Feb 13, 2021 at 12:52:23PM +0100, Lars Ingebrigtsen wrote:
> Alan Third <alan@idiocy.org> writes:
> 
> > No, on macOS retina screens it will display raster images at
> > 1/scale-factor size in image-mode, which is 1:1 with physical pixels
> > on the screen.
> 
> But that's not what image-scaling-factor is about -- it's about scaling
> images up on HiDPI screens (to make them visually larger, i.e., the same
> size as on a non-HiDPI screen).  So it sounds like this is a roundabout
> way of setting image-scaling-factor back to 1?

Ah, I've misunderstood how GTK deals with scaling. I could've sworn
someone said upthread that SVG images are shown at double size, the
same as on macOS, but apparently not.

So we have the situation where on macOS everything is shown at logical
size, unless you specifically ask for it not to be, and on GTK
everything is shown at physical size, unless you ask for it not to be.

And they both use "scale factor" for these same things.

What does the PGTK port do? The same as XGTK?

Nope, it's the same as on macOS.

So on macOS and PGTK we want to use the scale factor to scale down
images so they are displayed with physical pixels, and on XGTK we want
to scale up (UI?) images so they are displayed in logical pixels.

I'm somewhat inclined to ignore XGTKs desires, especially as it seems
it may be removed once PGTK is merged.

In case it's not clear what's going on, I've attached a screenshot of
Emacs on macOS with my patch installed (left), and on PGTK with
GDK_SCALE=2 and without my patch (right). Both displaying the same SVG
file.

> Uhm...  but on Macos, Emacs doesn't know the physical pixel size, I
> think you said earlier?  So...  er...  now I'm confused.  :-)

It's something you have to go looking for specifically, usually
through multiplying by the scale factor. The reason I said I wouldn't
want Emacs to convert everything to physical pixels is because every
single size would have to be multiplied or divided by the scale
factor, and then Emacs would appear to be half the size of every other
app (font sizes would be half what they are in the terminal, for
example).
-- 
Alan Third

Attachment: Screenshot 2021-02-13 at 12.53.43.png
Description: PNG image


reply via email to

[Prev in Thread] Current Thread [Next in Thread]