37 const auto finish_section_fn = [&](
const rcti cur_section_bounds) {
39 std::abs(section_bounds.
last().xmax - cur_section_bounds.xmin) <
42 section_bounds.
last().xmax = cur_section_bounds.xmax;
45 section_bounds.
append(cur_section_bounds);
48 rcti &last_bounds = section_bounds.
last();
54 last_bounds.
xmax = region->winx;
59 bool has_section_content =
false;
60 rcti cur_section_bounds;
67 const bool is_drawing = region->do_draw &
RGN_DRAWING;
69 if (is_drawing && !block->active) {
76 if (has_section_content) {
77 finish_section_fn(cur_section_bounds);
81 has_section_content =
false;
89 has_section_content =
true;
94 if (has_section_content) {
95 finish_section_fn(cur_section_bounds);
106 for (
rcti &bounds : section_bounds) {
116 return section_bounds;
123 const float corner_radius)
128 for (
const rcti &bounds : section_bounds) {
129 int roundbox_corners = [align]() ->
int {
142 if (bounds.xmin == 0) {
145 if (bounds.xmax >= region->winx) {
168 const float corner_radius)
186 immRecti(
pos, 0, region->winy - separator_line_width, region->winx, region->winy);
189 immRecti(
pos, 0, 0, region->winx, separator_line_width);
198 for (
const rcti &bounds : section_bounds) {
199 if (prev_xmax != 0) {
200 const rcti rounded_corner_rect = {
201 prev_xmax, bounds.
xmin, separator_line_width, region->winy - separator_line_width};
209 prev_xmax = bounds.xmax;
221 const float corner_radius = 4.0f *
UI_SCALE_FAC / aspect;
226 region, section_bounds,
ThemeColorID(colorid), align, corner_radius);
241 for (
const rcti &bounds : section_bounds) {
#define BLI_assert_unreachable()
#define LISTBASE_FOREACH(type, var, list)
void BLI_rcti_init_minmax(struct rcti *rect)
void BLI_rcti_pad(struct rcti *rect, int pad_x, int pad_y)
bool BLI_rcti_isect_x(const rcti *rect, int x)
BLI_INLINE int BLI_rcti_size_x(const struct rcti *rct)
void BLI_rctf_rcti_copy(struct rctf *dst, const struct rcti *src)
BLI_INLINE float BLI_rctf_size_x(const struct rctf *rct)
void BLI_rcti_do_minmax_rcti(struct rcti *rect, const struct rcti *other)
@ GPU_SHADER_3D_UNIFORM_COLOR
void GPU_blend(eGPUBlend blend)
void UI_draw_roundbox_4fv(const rctf *rect, bool filled, float rad, const float col[4])
const uiStyle * UI_style_get_dpi()
void UI_draw_roundbox_corner_set(int type)
#define UI_BUTTON_SECTION_SEPERATOR_LINE_WITH
#define UI_BUTTON_SECTION_MERGE_DISTANCE
void UI_GetThemeColor4fv(int colorid, float col[4])
void append(const T &value)
const T & last(const int64_t n=0) const
void ui_but_to_pixelrect(rcti *rect, const ARegion *region, const uiBlock *block, const uiBut *but)
void ui_draw_rounded_corners_inverted(const rcti &rect, const float rad, const blender::float4 color)
ccl_device_inline float3 ceil(const float3 a)