[Bf-committers] DPI scaling question...

Ton Roosendaal ton at blender.org
Sat Jun 29 12:42:40 CEST 2013


Hi,

I tried to add DPI scaling and retina (pixelsize) support in the least intrusive way for the code. The button views (layout engine) behave very nice for it. Similarly easy was for 3D views, FCurve editor, Image, etc.

However, Node Editor is an exception. It uses 2D elements (nodes) and UI widgets together in 1 view matrix. I choose to make it work using the way how views for UI widgets work, but that meant it had to handle the view scaling for node drawing itself differently.

It think it's acceptable, also because it was my impression we would look into reducing (or even remove) UI widgets in nodes in future anyway.

That's the main 'bad' exception for HiDPI in Blender code now. (Plus a hack in window manager to wrap window sizes).

Everything is under the hood so can be redesigned in other ways too.

-Ton-

--------------------------------------------------------
Ton Roosendaal  -  ton at blender.org   -   www.blender.org
Chairman Blender Foundation - Producer Blender Institute
Entrepotdok 57A  -  1018AD Amsterdam  -  The Netherlands



On 27 Jun, 2013, at 13:43, Brecht Van Lommel wrote:

> On Thu, Jun 27, 2013 at 9:38 AM, David Jeske <davidj at gmail.com> wrote:
>> ...which brings us back to my original question. Why is DPI exposed to so
>> much blender code? If there was a virtual coordinate system and DPI/PIXEL
>> scaling was hidden, then none of these places would know about DPI, node
>> placement would be right, and node spacing would be consistent.
>> 
>> Is this to avoid a wrapper around the GL calls for 2d operations? Does that
>> overhead matter? They could be inlined.
> 
> I don't know the reason behind this, Ton decided to do it this way
> when he worked on DPI and later retina support. I would have
> implemented it at a lower level too in the UI code, though maybe not
> as an OpenGL wrapper because you still want to round to integer
> coordinates for final button drawing I think, or have line thickness
> of 1 or 2, not 1.5 if you want things to draw crisp.
> 
> Brecht.
> _______________________________________________
> Bf-committers mailing list
> Bf-committers at blender.org
> http://lists.blender.org/mailman/listinfo/bf-committers



More information about the Bf-committers mailing list