35#define CORNER_RESOLUTION 3
47 exter[0] = roundf(exter[0]);
48 exter[1] = roundf(exter[1]);
65 static blender::gpu::Batch *screen_edges_batch =
nullptr;
67 if (screen_edges_batch ==
nullptr) {
75 for (
int corner = 0; corner < 4; corner++) {
90 return screen_edges_batch;
93#undef CORNER_RESOLUTION
125 ScrArea *active_area =
nullptr;
149 active_area =
nullptr;
175 const float edge_thickness = float(
U.border_width) *
UI_SCALE_FAC;
178 const float shader_scale = edge_thickness +
EDITORRADIUS;
179 const float corner_coverage[10] = {
180 0.144f, 0.25f, 0.334f, 0.40f, 0.455, 0.5, 0.538, 0.571, 0.6, 0.625f};
181 const float shader_width = corner_coverage[
U.border_width - 1];
185 int verts_per_corner = 0;
210 (area == active_area) ? outline2 : outline1,
221 rctf rect = {SHRT_MAX, SHRT_MIN, SHRT_MAX, SHRT_MIN};
224 if (edge->v1->editflag && edge->v2->editflag) {
226 rect.
xmin = std::min({rect.
xmin, float(edge->v1->vec.x), float(edge->v2->vec.x)});
227 rect.
xmax = std::max({rect.
xmax, float(edge->v1->vec.x), float(edge->v2->vec.x)});
228 rect.
ymin = rect.
ymax = float(edge->v1->vec.y);
231 rect.
ymin = std::min({rect.
ymin, float(edge->v1->vec.y), float(edge->v2->vec.y)});
232 rect.
ymax = std::max({rect.
ymax, float(edge->v1->vec.y), float(edge->v2->vec.y)});
233 rect.
xmin = rect.
xmax = float(edge->v1->vec.x);
243 if (rect.
xmin > (window_rect.
xmin + 2)) {
246 if (rect.
xmax < (window_rect.
xmax - 2)) {
251 if (rect.
ymin > (window_rect.
ymin + 2)) {
254 if (rect.
ymax < (window_rect.
ymax - 2)) {
268 float inner[4] = {1.0f, 1.0f, 1.0f, 0.4f};
274 &rect, inner,
nullptr, 1.0f, outline, width -
U.pixelsize, 2.5f *
UI_SCALE_FAC);
286 rect.
xmin = rect.
xmax - (4.0f *
U.pixelsize);
292 rect.
xmax = rect.
xmin + (4.0f *
U.pixelsize);
298 rect.
ymin = rect.
ymax - (4.0f *
U.pixelsize);
304 rect.
ymax = rect.
ymin + (4.0f *
U.pixelsize);
312 float inner[4] = {1.0f, 1.0f, 1.0f, 0.4f};
313 float outline[4] = {0.0f, 0.0f, 0.0f, 0.3f};
315 &rect, inner,
nullptr, 1.0f, outline, 1.0f *
U.pixelsize, 2.5f *
UI_SCALE_FAC);
319 const wmWindow *win,
int x,
int y,
const ScrArea *source,
const std::string &hint)
325 float col_fg[4], col_bg[4];
332 const float margin = scale * 4.0f;
334 const float icon_gap = scale * 3.0f;
335 const float line_gap = scale * 5.0f;
340 const float width = margin + std::max(line1_len, line2_len + icon_width + icon_gap) + margin;
341 const float height = margin + lheight + line_gap + lheight + margin;
357 top - height + margin + (1.0f * scale),
373 left + margin + icon_width + icon_gap,
374 top - height + margin - descent,
382 rctf rect = {float(xmin), float(xmax), float(ymin), float(ymax)};
383 float darken[4] = {0.0f, 0.0f, 0.0f, 0.7f};
412 if (offset1 < 0 || offset2 > 0) {
454 float outline[4] = {1.0f, 1.0f, 1.0f, 0.4f};
455 float inner[4] = {1.0f, 1.0f, 1.0f, 0.10f};
475 for (
int a = 0; a < 4; a++) {
486 for (
int a = 0; a < 4; a++) {
497 for (
int a = 0; a < 4; a++) {
508 for (
int a = 0; a < 4; a++) {
519 for (
int a = 0; a < 4; a++) {
541 float outline[4] = {1.0f, 1.0f, 1.0f, 0.4f};
542 float inner[4] = {1.0f, 1.0f, 1.0f, 0.1f};
546 float half_line_width = float(
U.border_width) *
UI_SCALE_FAC;
560 remainder.
xmax =
split - half_line_width;
567 remainder.
xmin =
split + half_line_width;
574 remainder.
ymax =
split - half_line_width;
581 remainder.
ymin =
split + half_line_width;
606 IFACE_(
"Move area here"));
611 float outline[4] = {1.0f, 1.0f, 1.0f, 0.4f};
612 float inner[4] = {1.0f, 1.0f, 1.0f, 0.10f};
620 if (factor < 0.0001 || factor > 0.9999) {
626 float x = (1 - factor) * rect.
xmin + factor * rect.
xmax;
627 float y = (1 - factor) * rect.
ymin + factor * rect.
ymax;
630 float half_line_width = float(
U.border_width) *
UI_SCALE_FAC;
644 rect.
ymin =
y + half_line_width;
648 rect.
xmin =
x + half_line_width;
660 rect.
ymin =
y - half_line_width;
661 rect.
ymax =
y + half_line_width;
664 rect.
xmin =
x - half_line_width;
665 rect.
xmax =
x + half_line_width;
ScrArea ScrArea * BKE_screen_find_area_xy(const bScreen *screen, int spacetype, const int xy[2]) ATTR_NONNULL(1
void BLF_size(int fontid, float size)
int BLF_descender(int fontid) ATTR_WARN_UNUSED_RESULT
void BLF_color4fv(int fontid, const float rgba[4])
#define BLF_DRAW_STR_DUMMY_MAX
void BLF_draw(int fontid, const char *str, size_t str_len, ResultBLF *r_info=nullptr) ATTR_NONNULL(2)
float BLF_width(int fontid, const char *str, size_t str_len, ResultBLF *r_info=nullptr) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(2)
int BLF_height_max(int fontid) ATTR_WARN_UNUSED_RESULT
void BLF_position(int fontid, float x, float y, float z)
#define LISTBASE_FOREACH(type, var, list)
BLI_INLINE bool BLI_listbase_is_empty(const ListBase *lb)
void void BLI_INLINE bool BLI_listbase_is_single(const ListBase *lb)
MINLINE float max_ff(float a, float b)
void rgba_uchar_to_float(float r_col[4], const unsigned char col_ub[4])
MINLINE void mul_v2_fl(float r[2], float f)
MINLINE void copy_v2_v2(float r[2], const float a[2])
MINLINE void mul_v2_v2fl(float r[2], const float a[2], float f)
BLI_INLINE int BLI_rcti_size_y(const struct rcti *rct)
void BLI_rcti_init_minmax(struct rcti *rect)
BLI_INLINE int BLI_rcti_size_x(const struct rcti *rct)
void BLI_rctf_pad(struct rctf *rect, float pad_x, float pad_y)
BLI_INLINE int BLI_rcti_cent_y(const struct rcti *rct)
void BLI_rctf_rcti_copy(struct rctf *dst, const struct rcti *src)
void BLI_rcti_do_minmax_v(struct rcti *rect, const int xy[2])
BLI_INLINE int BLI_rcti_cent_x(const struct rcti *rct)
int ED_area_icon(const ScrArea *area)
blender::StringRefNull ED_area_name(const ScrArea *area)
static void split(const char *text, const char *seps, char ***str, int *count)
blender::gpu::Batch * GPU_batch_create_ex(GPUPrimType primitive_type, blender::gpu::VertBuf *vertex_buf, blender::gpu::IndexBuf *index_buf, eGPUBatchFlag owns_flag)
#define GPU_batch_uniform_1f(batch, name, x)
void GPU_batch_program_set_builtin(blender::gpu::Batch *batch, eGPUBuiltinShader shader_id)
void GPU_batch_draw(blender::gpu::Batch *batch)
#define GPU_batch_uniform_4fv(batch, name, val)
#define GPU_batch_uniform_1i(batch, name, x)
void gpu_batch_presets_register(blender::gpu::Batch *preset_batch)
@ GPU_SHADER_3D_UNIFORM_COLOR
@ GPU_SHADER_2D_AREA_BORDERS
void GPU_blend(eGPUBlend blend)
void GPU_scissor_test(bool enable)
void GPU_scissor(int x, int y, int width, int height)
#define GPU_vertbuf_create_with_format(format)
void GPU_vertbuf_attr_set(blender::gpu::VertBuf *, uint a_idx, uint v_idx, const void *data)
void GPU_vertbuf_data_alloc(blender::gpu::VertBuf &verts, uint v_len)
void UI_draw_roundbox_4fv(const rctf *rect, bool filled, float rad, const float col[4])
void UI_draw_roundbox_4fv_ex(const rctf *rect, const float inner1[4], const float inner2[4], float shade_dir, const float outline[4], float outline_width, float rad)
#define UI_DEFAULT_TOOLTIP_POINTS
void UI_draw_roundbox_corner_set(int type)
#define UI_FSTYLE_TOOLTIP
#define UI_NO_ICON_OVERLAY_TEXT
void UI_icon_draw_ex(float x, float y, int icon_id, float aspect, float alpha, float desaturate, const uchar mono_color[4], bool mono_border, const IconTextOverlay *text_overlay, const bool inverted=false)
#define ICON_DEFAULT_WIDTH
@ TH_EDITOR_OUTLINE_ACTIVE
void UI_GetThemeColor4fv(int colorid, float col[4])
static btDbvtVolume bounds(btDbvtNode **leaves, int count)
struct @064345207361167251075330302113175271221317160336::@113254110077376341056327177062323111323010325277 batch
VecBase< int32_t, 2 > int2
void screen_draw_region_scale_highlight(ARegion *region)
static void drawscredge_area(const ScrArea &area, float edge_thickness)
Screen edges drawing.
void screen_draw_move_highlight(const wmWindow *win, bScreen *screen, eScreenAxis dir_axis)
static void rounded_corners(rctf rect, float color[4], int corners)
void screen_draw_split_preview(ScrArea *area, const eScreenAxis dir_axis, const float factor)
void ED_screen_draw_edges(wmWindow *win)
#define CORNER_RESOLUTION
static void screen_draw_area_closed(int xmin, int xmax, int ymin, int ymax)
void screen_draw_join_highlight(const wmWindow *win, ScrArea *sa1, ScrArea *sa2, eScreenDir dir)
static void do_vert_pair(blender::gpu::VertBuf *vbo, uint pos, uint *vidx, int corner, int i)
void screen_draw_dock_preview(const wmWindow *win, ScrArea *source, ScrArea *target, AreaDockTarget dock_target, float factor, int x, int y)
static void screen_draw_area_drag_tip(const wmWindow *win, int x, int y, const ScrArea *source, const std::string &hint)
static blender::gpu::Batch * batch_screen_edges_get(int *corner_len)
void area_getoffsets(ScrArea *sa_a, ScrArea *sa_b, const eScreenDir dir, int *r_offset1, int *r_offset2)
AZone * ED_area_actionzone_find_xy(ScrArea *area, const int xy[2])
#define SCREEN_DIR_IS_VERTICAL(dir)
uiWidgetColors wcol_tooltip
struct ARegion * active_region
struct wmEvent * eventstate
int WM_window_native_pixel_x(const wmWindow *win)
void WM_window_screen_rect_calc(const wmWindow *win, rcti *r_rect)
bScreen * WM_window_get_active_screen(const wmWindow *win)