[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: |
Thu, 11 Feb 2021 20:18:41 +0000 |
On Thu, Feb 11, 2021 at 12:34:50PM -0500, Yuan Fu wrote:
> >>
> >> Attached is a first go at this. I can't work out image.el and
> >> image-mode.el, so I'll either need a lot more time or someone more
> >> familiar with them can have a look.
> >>
> >> The basic problem is that image-size returns physical pixels, and we
> >> want to calculate logical pixels. I tried a few things and failed
> >> miserably. I tried changing image-size to return logical pixels, but
> >> that just seemed to make everything worse, and I don't think it's a
> >> good idea to lie about the image size.
> >
> > I’m not sure what do you want to achieve here. Are you trying to
> > automatically size bitmap images when opening them, so that it is displayed
> > 1:1 to physical pixels? If can do something like this:
> >
> > (insert-image (create-image "~/d/Screen Shot 2021-02-09 at
> > 10.11.56 AM.png" nil nil :scale (/ 1
> > (frame-scale-factor))))
> >
> > And the image inserted is displayed 1:1 to physical pixels. But
> > :scale is not really meant for controlling pixel ratio. Maybe we
> > should add a :pixel-ratio (or :scale-factor) attribute to control
> > the default display size of a bitmap image?
>
> Actually, :pixel-ratio probably isn’t a good idea. I guess we should
> just let the user decide what they want when inserting an image, and
> automatically add :scale in image-mode.
Yes, I agree. That's really what I was struggling with, getting
image-mode to load the image at physical pixel size. I don't do much
lisp coding, so I'm quite slow to get to understand it.
I'll keep looking, though.
--
Alan Third
- Re: Cleaning out old X11 toolkits?, (continued)
- Re: "Fix" sag scaling for hidpi, Stefan Monnier, 2021/02/10
- Re: "Fix" sag scaling for hidpi, Robert Pluim, 2021/02/11
- Re: "Fix" sag scaling for hidpi, Stefan Monnier, 2021/02/11
- Re: "Fix" sag scaling for hidpi, Robert Pluim, 2021/02/11
- Re: "Fix" sag scaling for hidpi, Alan Third, 2021/02/10
- Re: "Fix" sag scaling for hidpi, Yuan Fu, 2021/02/10
- Re: "Fix" sag scaling for hidpi, Yuan Fu, 2021/02/11
- Re: "Fix" sag scaling for hidpi,
Alan Third <=
- Re: "Fix" sag scaling for hidpi, Alan Third, 2021/02/12
- Re: "Fix" sag scaling for hidpi, Lars Ingebrigtsen, 2021/02/13
- Re: "Fix" sag scaling for hidpi, Alan Third, 2021/02/13
- Re: "Fix" sag scaling for hidpi, Lars Ingebrigtsen, 2021/02/13
- Re: "Fix" sag scaling for hidpi, Alan Third, 2021/02/13
- Re: "Fix" sag scaling for hidpi, Alan Third, 2021/02/13
- Re: "Fix" sag scaling for hidpi, Lars Ingebrigtsen, 2021/02/13
- Re: "Fix" sag scaling for hidpi, Alan Third, 2021/02/13
- Re: "Fix" sag scaling for hidpi, Alan Third, 2021/02/13
- Re: "Fix" sag scaling for hidpi, Yuan Fu, 2021/02/13