This patch improves the scaling of some ui widgets when zooming by
making the radius of the rounded corners dependent on the element's
scale.
This improvement is most noticeable in the node editor.
---
| **master** | **patch** |
|------------|-----------|
| {F11019420} | {F11019425} |
**Issue**
Most UI widgets have a fixed corner radius based on the constant
`U.widget_unit` that is scaled by the `roundness` defined in the theme.
This means that, when the size of these widgets changes (e.g. when
zooming into nodes or scaling regions with `ctrl + mousewheel`) the
absolute corner radius in screen space stays the same, but changes
relatively to the element.
**Approach**
Instead of a constant corner radius, the corner rounding should be
scaled by the `aspect` of the block the widget is in.
In most parts of the UI it won't make a difference.
In principle this approach should work for all widgets, but there are
some that don't have access to the `aspect` or have a special shape
(like the scrollbars) where basing it on `U.widget_unit` wouldn't
make sense. Those widgets use are unchanged and calculate the
corner radius based on the height on the element, which works
with any zoom level.
**Limitations**
Currently popovers (with the triangle pointing at the button) stay
with a fixed corner radius, that doesn't adjust to the zoom.
**Side Effects**
I still have to check more areas of blender to see whether I missed
something, but so far I haven't found any unintended side effects.