42 const auto finish_section_fn = [&](
const rcti cur_section_bounds) {
44 std::abs(section_bounds.
last().xmax - cur_section_bounds.xmin) <
47 section_bounds.
last().xmax = cur_section_bounds.xmax;
50 section_bounds.
append(cur_section_bounds);
53 rcti &last_bounds = section_bounds.
last();
64 bool has_section_content =
false;
65 rcti cur_section_bounds;
74 if (is_drawing && !block->active) {
78 for (
const std::unique_ptr<uiBut> &but : block->buttons) {
81 if (has_section_content) {
82 finish_section_fn(cur_section_bounds);
86 has_section_content =
false;
94 has_section_content =
true;
99 if (has_section_content) {
100 finish_section_fn(cur_section_bounds);
121 return section_bounds;
128 const float corner_radius)
134 int roundbox_corners = [align]() ->
int {
173 const float corner_radius)
186 format,
"pos", blender::gpu::VertAttrType::SFLOAT_32_32);
204 if (prev_xmax != 0) {
205 const rcti rounded_corner_rect = {
206 prev_xmax,
bounds.xmin, separator_line_width, region->
winy - separator_line_width};
226 const float corner_radius = 4.0f *
UI_SCALE_FAC / aspect;
231 region, section_bounds,
ThemeColorID(colorid), align, corner_radius);
#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(GPUBlend 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)
ARegionRuntimeHandle * runtime