44 return area->v2->vec.y -
area->v1->vec.y + 1;
48 return area->v4->vec.x -
area->v1->vec.x + 1;
91 const rcti *bounds_rect,
101 if ((se->v1->vec.y > bounds_rect->
ymin) && (se->v1->vec.y < (bounds_rect->
ymax - 1))) {
103 min =
MIN2(se->v1->vec.x, se->v2->vec.x);
104 max =
MAX2(se->v1->vec.x, se->v2->vec.x);
106 if (
abs(my - se->v1->vec.y) <= safety && mx >=
min && mx <=
max) {
112 if ((se->v1->vec.x > bounds_rect->
xmin) && (se->v1->vec.x < (bounds_rect->
xmax - 1))) {
114 min =
MIN2(se->v1->vec.y, se->v2->vec.y);
115 max =
MAX2(se->v1->vec.y, se->v2->vec.y);
117 if (
abs(mx - se->v1->vec.x) <= safety && my >=
min && my <=
max) {
154 const rcti *screen_rect)
159 bool needs_another_pass =
false;
162 float min[2] = {20000.0f, 20000.0f};
163 float max[2] = {0.0f, 0.0f};
166 const float fv[2] = {(
float)sv->vec.x, (
float)sv->vec.y};
170 int screen_size_x_prev = (
max[0] -
min[0]) + 1;
171 int screen_size_y_prev = (
max[1] -
min[1]) + 1;
173 if (screen_size_x_prev != screen_size_x || screen_size_y_prev != screen_size_y) {
174 const float facx = ((
float)screen_size_x - 1) / ((
float)screen_size_x_prev - 1);
175 const float facy = ((
float)screen_size_y - 1) / ((
float)screen_size_y_prev - 1);
198 const int yval =
area->v1->vec.y + headery - 1;
209 needs_another_pass =
true;
224 const int yval =
area->v2->vec.y - headery + 1;
235 needs_another_pass =
true;
245 return needs_another_pass;
257 rcti window_rect, screen_rect;
261 bool needs_another_pass;
262 int max_passes_left = 10;
266 }
while (needs_another_pass && (max_passes_left > 0));
277 if (
area->v1->vec.y > window_rect.
ymin) {
280 if (
area->v2->vec.y < (window_rect.
ymax - 1)) {
286 area->v3->vec.x =
area->v4->vec.x = window_rect.
xmax - 1;
289 area->v2->vec.y =
area->v3->vec.y = window_rect.
ymax - 1;
291 switch (
area->global->align) {
306 const rcti *window_rect,
316 if ((dir ==
'v') && (cur_area_width <= 2 * area_min_x)) {
319 if ((dir ==
'h') && (cur_area_height <= 2 * area_min_y)) {
324 CLAMP(fac, 0.0f, 1.0f);
329 int area_min = area_min_y;
331 if (
area->v1->vec.y > window_rect->
ymin) {
332 area_min +=
U.pixelsize;
334 if (
area->v2->vec.y < (window_rect->
ymax - 1)) {
335 area_min +=
U.pixelsize;
338 if (
y -
area->v1->vec.y < area_min) {
339 y =
area->v1->vec.y + area_min;
341 else if (
area->v2->vec.y -
y < area_min) {
342 y =
area->v2->vec.y - area_min;
350 int area_min = area_min_x;
352 if (
area->v1->vec.x > window_rect->
xmin) {
353 area_min +=
U.pixelsize;
355 if (
area->v4->vec.x < (window_rect->
xmax - 1)) {
356 area_min +=
U.pixelsize;
359 if (
x -
area->v1->vec.x < area_min) {
360 x =
area->v1->vec.x + area_min;
362 else if (
area->v4->vec.x -
x < area_min) {
363 x =
area->v4->vec.x - area_min;
394 bool oneselected =
true;
395 while (oneselected) {
398 if (se->v1->flag + se->v2->flag == 1) {
400 if (se->v1->vec.y == se->v2->vec.y) {
401 se->v1->flag = se->v2->flag = 1;
406 if (se->v1->vec.x == se->v2->vec.x) {
407 se->v1->flag = se->v2->flag = 1;
typedef float(TangentPoint)[2]
struct ScrEdge * BKE_screen_find_edge(const struct bScreen *screen, struct ScrVert *v1, struct ScrVert *v2)
void BKE_screen_sort_scrvert(struct ScrVert **v1, struct ScrVert **v2)
#define LISTBASE_FOREACH(type, var, list)
void BLI_addtail(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
MINLINE short round_fl_to_short(float a)
void minmax_v2v2_v2(float min[2], float max[2], const float vec[2])
BLI_INLINE int BLI_rcti_size_y(const struct rcti *rct)
BLI_INLINE int BLI_rcti_size_x(const struct rcti *rct)
#define AREAMAP_FROM_SCREEN(screen)
@ GLOBAL_AREA_ALIGN_BOTTOM
int ED_area_global_size_y(const ScrArea *area)
#define ED_screen_verts_iter(win, screen, vert_name)
int ED_area_headersize(void)
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei height
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint y
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint GLsizei GLsizei GLenum type _GL_VOID_RET _GL_VOID GLsizei GLenum GLenum const void *pixels _GL_VOID_RET _GL_VOID const void *pointer _GL_VOID_RET _GL_VOID GLdouble v _GL_VOID_RET _GL_VOID GLfloat v _GL_VOID_RET _GL_VOID GLint GLint i2 _GL_VOID_RET _GL_VOID GLint j _GL_VOID_RET _GL_VOID GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble GLdouble GLdouble zFar _GL_VOID_RET _GL_UINT GLdouble *equation _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLenum GLfloat *v _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLfloat *values _GL_VOID_RET _GL_VOID GLushort *values _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLenum GLdouble *params _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_BOOL GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLushort pattern _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint GLdouble v1
Read Guarded memory(de)allocation.
Group RGB to Bright Vector Camera CLAMP
ATTR_WARN_UNUSED_RESULT const BMVert * v2
void *(* MEM_callocN)(size_t len, const char *str)
static void area(int d1, int d2, int e1, int e2, float weights[2])
ScrEdge * screen_geom_area_map_find_active_scredge(const ScrAreaMap *area_map, const rcti *bounds_rect, const int mx, const int my)
short screen_geom_find_area_split_point(const ScrArea *area, const rcti *window_rect, char dir, float fac)
void screen_geom_select_connected_edge(const wmWindow *win, ScrEdge *edge)
bool screen_geom_edge_is_horizontal(ScrEdge *se)
ScrEdge * screen_geom_find_active_scredge(const wmWindow *win, const bScreen *screen, const int mx, const int my)
static bool screen_geom_vertices_scale_pass(const wmWindow *win, const bScreen *screen, const rcti *screen_rect)
ScrEdge * screen_geom_edge_add(bScreen *screen, ScrVert *v1, ScrVert *v2)
ScrVert * screen_geom_vertex_add(bScreen *screen, short x, short y)
int screen_geom_area_width(const ScrArea *area)
ScrEdge * screen_geom_edge_add_ex(ScrAreaMap *area_map, ScrVert *v1, ScrVert *v2)
int screen_geom_area_height(const ScrArea *area)
ScrVert * screen_geom_vertex_add_ex(ScrAreaMap *area_map, short x, short y)
void screen_geom_vertices_scale(const wmWindow *win, bScreen *screen)
Main screen-layout calculation function.
__forceinline const avxi abs(const avxi &a)
bScreen * WM_window_get_active_screen(const wmWindow *win)
void WM_window_rect_calc(const wmWindow *win, rcti *r_rect)
void WM_window_screen_rect_calc(const wmWindow *win, rcti *r_rect)