UI: Positioning of 3DView Sidebar Tab Titles #119231
|
@ -1342,8 +1342,6 @@ void UI_panel_category_draw_all(ARegion *region, const char *category_id_active)
|
|||
/* Intentionally don't scale by 'px'. */
|
||||
const int rct_xmin = is_left ? v2d->mask.xmin + 3 : (v2d->mask.xmax - category_tabs_width);
|
||||
const int rct_xmax = is_left ? v2d->mask.xmin + category_tabs_width : (v2d->mask.xmax - 3);
|
||||
const int text_v_ofs = (rct_xmax - rct_xmin) * 0.3f;
|
||||
|
||||
int y_ofs = tab_v_pad;
|
||||
|
||||
/* Primary theme colors. */
|
||||
|
@ -1504,8 +1502,14 @@ void UI_panel_category_draw_all(ARegion *region, const char *category_id_active)
|
|||
|
||||
/* Tab titles. */
|
||||
|
||||
/* Offset toward the middle of the rect. */
|
||||
const int text_v_ofs = (rct_xmax - rct_xmin) * 0.5f;
|
||||
/* Offset down as the font size increases. */
|
||||
const int text_size_offset = int(fstyle_points * UI_SCALE_FAC * 0.35f);
|
||||
|
||||
BLF_position(fontid,
|
||||
is_left ? rct->xmax - text_v_ofs : rct->xmin + text_v_ofs,
|
||||
is_left ? rct->xmax - text_v_ofs + text_size_offset :
|
||||
rct->xmin + text_v_ofs - text_size_offset,
|
||||
is_left ? rct->ymin + tab_v_pad_text : rct->ymax - tab_v_pad_text,
|
||||
0.0f);
|
||||
BLF_color3ubv(fontid, is_active ? theme_col_text_hi : theme_col_text);
|
||||
|
|
Loading…
Reference in New Issue