diff options
author | Leon Leno <lone_noel> | 2021-11-24 23:04:29 +0300 |
---|---|---|
committer | Julian Eisel <julian@blender.org> | 2021-11-24 23:06:32 +0300 |
commit | a9642f8d613078b285db4b04efb8bf8e5a234fbb (patch) | |
tree | 424f5c6901aa58592369ceb8d00f28aa413c0339 /source/blender/editors/interface/interface_draw.c | |
parent | 752c6d668bcb9a6b357734f7e124a6b605ac9d9b (diff) |
UI: Improve scaling of widgets when zooming
This commit improves the scaling of some ui widgets when
zooming by making the radius of the rounded corners
dependent on the element's zoom level.
Needed to fix T92278 without padding issues, see D13125.
Reviewed By: Hans Goudey, Julian Eisel
Differential Revision: https://developer.blender.org/D12842
Diffstat (limited to 'source/blender/editors/interface/interface_draw.c')
-rw-r--r-- | source/blender/editors/interface/interface_draw.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/source/blender/editors/interface/interface_draw.c b/source/blender/editors/interface/interface_draw.c index e45a5fc61c6..191eb6b5585 100644 --- a/source/blender/editors/interface/interface_draw.c +++ b/source/blender/editors/interface/interface_draw.c @@ -1351,7 +1351,10 @@ void ui_draw_but_COLORBAND(uiBut *but, const uiWidgetColors *UNUSED(wcol), const immUnbindProgram(); } -void ui_draw_but_UNITVEC(uiBut *but, const uiWidgetColors *wcol, const rcti *rect) +void ui_draw_but_UNITVEC(uiBut *but, + const uiWidgetColors *wcol, + const rcti *rect, + const float radius) { /* sphere color */ const float diffuse[3] = {1.0f, 1.0f, 1.0f}; @@ -1368,7 +1371,7 @@ void ui_draw_but_UNITVEC(uiBut *but, const uiWidgetColors *wcol, const rcti *rec .ymax = rect->ymax, }, true, - 5.0f, + radius, wcol->inner, 255); |