[Bf-committers] DPI scaling question...

Campbell Barton ideasman42 at gmail.com
Thu Jun 27 08:53:32 CEST 2013


Noticed node placement bug this morning,
fixed r57813.

Though IMHO using DPI to coords for node placement isn't a good idea
(anything besides drawing), but perhaps theres a good reason for it?

On Thu, Jun 27, 2013 at 2:56 PM, David Jeske <davidj at gmail.com> wrote:
> I'm trying to fix some Macbook Retina DPI scaling bugs, and I need some
> background on the UI_DPI_FAC.
>
> The first bug is that new compositor nodes are placed wrong on retina. I
> can see where they are created and placed in scripts/startup/bl_operators.
> However, I don't understand where DPI scaling is supposed to happen.
>
> It surprises me to see code all over which deals with DPI factor like
> this...
>
>  y = (ypixels <= 39.0f * UI_DPI_FAC) ? (ypixels - 10.0f * UI_DPI_FAC) :
> 29.0f * UI_DPI_FAC;
>
> I expected it to be more centralized, where the whole UI would run in a
> virtualized coordinate-space automatically adjusted for DPI, and DPI
> scaling would be handled in the core mouse-event delivery and drawing code.
> Only a few places that care about raw pixels or should not respond to dpi
> changes would need to interact with DPI.
>
> I suspect there is a reason it wasn't done this way, but I don't know what
> it is, so it's hard for me to understand where DPI scaling should be done
> to fix these bugs.
>
> Can anyone enlighten me?
> _______________________________________________
> Bf-committers mailing list
> Bf-committers at blender.org
> http://lists.blender.org/mailman/listinfo/bf-committers



-- 
- Campbell


More information about the Bf-committers mailing list