diff options
Diffstat (limited to 'source/blender/editors/interface/interface_widgets.c')
-rw-r--r-- | source/blender/editors/interface/interface_widgets.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/source/blender/editors/interface/interface_widgets.c b/source/blender/editors/interface/interface_widgets.c index d1f3843c643..35cf952b5ce 100644 --- a/source/blender/editors/interface/interface_widgets.c +++ b/source/blender/editors/interface/interface_widgets.c @@ -3319,6 +3319,8 @@ static void ui_draw_separator(const rcti *rect, const uiWidgetColors *wcol) /** \name Button Draw Callbacks * \{ */ +#define NUM_BUT_PADDING_FACTOR 0.425f + static void widget_numbut_draw( uiWidgetColors *wcol, rcti *rect, const float zoom, int state, int roundboxalign, bool emboss) { @@ -3413,11 +3415,10 @@ static void widget_numbut_draw( } if (!(state & UI_STATE_TEXT_INPUT)) { - const float textofs = 0.425f * BLI_rcti_size_y(rect); + const float text_padding = NUM_BUT_PADDING_FACTOR * BLI_rcti_size_y(rect); - /* text space */ - rect->xmin += textofs; - rect->xmax -= textofs; + rect->xmin += text_padding; + rect->xmax -= text_padding; } } @@ -3745,7 +3746,6 @@ static void widget_numslider( /* Backdrop first. */ const float ofs = widget_radius_from_zoom(zoom, wcol); - const float toffs = ofs * 0.75f; round_box_edges(&wtb, roundboxalign, rect, ofs); wtb.draw_outline = false; @@ -3838,8 +3838,9 @@ static void widget_numslider( /* Add space at either side of the button so text aligns with number-buttons * (which have arrow icons). */ if (!(state & UI_STATE_TEXT_INPUT)) { - rect->xmax -= toffs; - rect->xmin += toffs; + const float text_padding = NUM_BUT_PADDING_FACTOR * BLI_rcti_size_y(rect); + rect->xmax -= text_padding; + rect->xmin += text_padding; } } |